faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 18 people (78%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

I can't upload to my database via php. My script appears to go thought alright, and I can echo the variables, but when I check the db, the info is not there. I can, however, get data from the db. I'm using root, so my permissions are ok.

Jan 25th, 2001 09:05
Joshua Ariizumi, Guest,


When you pass data to a script, the script runs fine, but still don't 
see the effect on the database, you should verify that the query 
executed properly.  Most frequently, it's a column number mismatch or 
missing quotes.  The best thing to do is to have a query so that it 
returns the error:
mysql_query("INSERT INTO table VALUES(1, 2, 3)") or die
("Error: ".mysql_error());
which would give out the exact nature of the error.  To debug your 
pages, it might be worth echoing your query so you know if you've 
accidentally misspelled a variable name, etc.