|
-
June 20th, 2010, 04:44 AM
#1
[RESOLVED] "Unknown column test3 in field list" error in MySQL
Hi,
I'm trying to do this:
Code:
$sqlAdd[$i] = "INSERT INTO ct_".$country." (name, url) VALUES (test3, test)";
if (!mysql_query(mysql_real_escape_string($sqlAdd[$i]), $con)) {
die('Error: ' . mysql_error());
}
(adding into the table ct_int in the name and url rows, the values test3 and test)
The error I get is:
Error: Unknown column 'test3' in 'field list'
How come its looking for column "test3" it should be looking for the column "name"? What's up with that ey?
Kind Regards
EDIT: I fixed the above issue by calling mysql_query("SQL code") rather than putting it in the variable first... idk why that fixed it
Last edited by Icyculyr; June 20th, 2010 at 05:36 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|