[thelist] mySQL/PHP - INSERT not working
Johnson, Christopher (MTO)
Christopher.Johnson at mto.gov.on.ca
Thu Jun 17 10:28:12 CDT 2004
Two questions:
1. What kind of error are you getting when you try to run the query? This
may sound like a dumb question, but how do you know that the query is not
running?
2. Try this and see what is printed out.
$query = "INSERT INTO scouting (playerID, report) VALUES
('".$pid."','".$scout."')";
The fact that you can print out the values for your POST variables does not
mean that your sql statement is sound.
chris
-----Original Message-----
From: Tom Dell'Aringa
Little help please, I have this INSERT:
include 'inc/config.php'; // config contains my DB connection
$scout = $_POST['scoutReport'];
$pid = $_POST['pid'];
mysql_query("INSERT INTO scouting (playerID, report) VALUES
('$pid','$scout')");
I've printed out the values for the POST variables and they are coming over.
I can run the insert
successfully in mySQL and it works. But it won't work in my php page - am I
forgetting something?
It's been awhile...
More information about the thelist
mailing list