mysql

Is it possible to check a md5 password

More precisely: i want to check if the user enters his same password as the one store in the DB for its profile. i have tried something like this but i dont get an echo: $query2=mysql_query("SELECT emails_password,emails_id FROM lala.in_emails WHERE emails_password ='md5($password)' AND emails_id='".$_COOKIE['LALA_ID']."'")or die(mys...

mysql: need code for search data

i need some code for search some data inside DB... i have two fields that is id and name... if i type "ABC" it can show all data about "ABC".. if "DEF"=>all DEF data...or i type anything it can show that "anything"... i'm just know how to show all data inside fields that makes "ABC" and "DEF" show together,the code like this: "SELECT I...

Excute an array with while statement

Ok i am tryna make this code excute for every phone number in my db. Before following advice here i was only able to send to one number at a time, i got advice to add a while statment to loop it. However my code don't wanna work no more. Here is before and after. I know i did something wrong. BEFORE (Working-no db) // Set SMS options $...

Query to get data from two tables

Hello, I'm trying to get data from two MySQL tables, but having problems. Usually, I'd use join to get data from two those tables depending on data, but this time I cannot, I think. Here's situation: I'm having tables photos and photos_albums. photos ID ALBUM FILENAME photos_albums ID TITLE NAME I need to get all albums and photo i...

How to filter the correct orders with MySQL (One order contains many lines)

I have to filter orders which do not have a specific product. It is simple, but the problem is that every order could have many lines, containing different products. Here is an example of my data: ID | Product | Customer | Quantidy | Date 1 | Apple | Alex Sorensen | 3 | 17.4.2009 2 | Orange | Alex Sorensen | 1 ...

Effectively notify when MySQL data entry changes

I've been using an HTTP POST to a php file to change entries in a given MySQL database. Essentially, the second the value changes, I would like the user that is viewing the database table to be notified. For now my temporary solution is to auto refresh a page displaying the table to keep it updated but I feel like there has to be a more ...

php code to test pdo is available?

I want to use PDO but I'm not sure whether my hosting has set it up properly. How can I test, in PHP, whether it is setup and working for MySQL? ...

How do I create a database if it doesn't exist, using PHP?

How do I create a database if it doesn't exist, using PHP? ...

Western European language mysql query problem

Hey I am programming a webpage where the user can upload galleries of his own. When doing so the system creates a subfolder for the images with the same name as the gallery, a reference to the gallery is added as a row in a table and a separate table is also made for the gallery, containing a list of images. When I try to create a new ...

query for what customers have bought together with the listed product

hi guys, i'm trying to get optimize an very old query that i can't wrap my head around. the result that i want to archive is that i want to recommend the visitor on a web shop what other customers have shown interest in, i.e. what else they have bought together with the product that the visitor is looking at. i have a subquery but it's ...

best character set and collation for European based website.

Hi, I am going to be building a application which will be used by people all over Europe. I need to know which collation and character set would be best suited for user inputted data. Or should I make a separate table for each language. A article to something explaining this would be great. Thanks :) ...

Joining tables in SQL

I am having trouble with a SQL query. SELECT t.topicname, m. *, ms.avatar FROM `messages` m INNER JOIN topics t ON m.topicid = t.topicid inner join users u on m.author=u.username inner join misc ms on u.userid=ms.userid ORDER BY postdate DESC LIMIT 5 what i want to do is get the topicname from the topics table, every...

Mysql stored procedure

I have created a stored procedure in Mysql, as : DELIMITER // CREATE PROCEDURE test() BEGIN SELECT * FROM buyers; END // DELIMITER ; but when i call it using, call test() it returns an error saying : #1312 - PROCEDURE ticketninja.test1 can't return a result set in the given context ...

How should I structure this database?

Hey, I am creating a website that will allow people to make lists, but I'm not sure on the best way to store these lists. Should I make a new table for each user, or is that a bad idea? There will be a few columns to each list. Thanks in advance Edit: It will be one list per user, although if it's pretty much the same, I may make it m...

Copying non existing rows from one database table to another database table?

I have the following 1 db table in Database 1 and 1db table in Database 2, now the stucture of both tables are exactly the same. Now what happens is table 1 (DB1) gets new rows added daily, I need to update the table 1 (DB 1) new rows in table 1 (DB 2) so that these 2 tables remain the same. A cron will trigger a php script on midnight t...

MySQL JOIN wrapping into an array

I have some minor problem with a SQL query. I have to select data from multiple tables like: Table structure offers: | id | offer      | info | 1  | City break | information pictures: | id | id_offer | picture_name  | title | 1  | 1        | bucharest.jpg | Bucharest | 2  | 1        | london.jpg    | London QUERY: SELECT offer...

phpmyadmin Error

I changed the password for MySQL root and now I can't login to phpmyadmin. I've rebooted, followed the directions here http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html and it still won't let me login. What else can I do to fix this? Thanks! ...

How to make this query: one field update anyway, another field only update in some condition?

updaten some_table set one_field=xxx, another_field=(only update in condition, ex. large then zero then minus one). ...

MySQL - auto decrementing value

Let's say that I've got a table, like that (id is auto-increment): id | col1 | col2 1 | 'msg'| 'msg' 2 | 'lol'| 'lol2' 3 | 'xxx'| 'x' Now, I want to delete row number 2 and I get something like this id | col1 | col2 1 | 'msg'| 'msg' 3 | 'xxx'| 'x' The thing is, what I want to get is that: id | col1 | col2 1 | 'msg'| 'msg' 2 ...

mysql vs ini files?

My php program is broken up into modules and each module has its own settings. These settings will hardly change, so would it be better to put the settings in a ini file or in a mysql database? If I go with the ini style then how hard is it to update the ini file? ...