Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mySQL query works on phpMyadmin but not in server

Status
Not open for further replies.

sbayter

IS-IT--Management
Nov 14, 2002
95
CO
Hi,
I have mySQL db and a simple page with a query which displays the db.
The page was working perfect but when I added dos more columns to the db it stoped working and now it doesn't display anything.
When I run the query in phpMyadmin it show all the info. but when i upload it to the server, it does not work.
Ann suggestions?
Thanks,

sbayter
 
What are the differences?

1. Compare the connection parameters - user, host, pass.
2. What is the error returned?
3. What is the SQL statement?

This will help to clarify.
 
This is a php page.

The query looks like this:

mysql_select_db($database_survey, $survey);
$query_Recordset = "SELECT * FROM customers";
$Recordset = mysql_query($query_Recordset, $survey) or die(mysql_error());
$row_Recordset = mysql_fetch_assoc($Recordset);
$totalRows_Recordset = mysql_num_rows($Recordset);

What I don't understand is that I only added two columns. It was working perfectly before then.



sbayter
 
... and it doesn't display any error.
It just displays an empty table.

sbayter
 
You have no errorcheck in the line where you select the database. Please add that, also in the connection line.

Did you check the access parameters?
 
I already have the errorcheck in my conection.
I'm relatively new to php.
What do you mean by access parameters? you mean the permissions? i so, i guess they are ok 'cause it was working before.

sbayter
 
Does your PHP script use the correct username, host, password?
Is the username allowed to connect to the mysql server from that IP?
Is the username allowed to access the database in question?

Something changed. We just need to track down what.
 
for the 3 questions the answer is yes.
Do you think the db could be losing its data when it is uploaded? can that happen?

sbayter
 
I do not believe that's possible.
You say that the query works fine issued from PHPMyAdmin. There is no difference to sending it from another PHP application. The reason must lie somewhere else.

I assume you are using the same server for PHPMyAdmin and the 'uploaded' version. Right?

 
I'm sure it is the same.
I'm really confused about this. I only added two columns, how big is that!!! :S

sbayter
 
Can you access MySQL fom the command line, log in, and issue the query?
 
Yes,
I tried that but it is also empty this is why i think the data is getting corrupted on the upload.
Any other suggestions?
Thanks,

sbayter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top