[thelist] mySQL/PHP - INSERT not working
Tom Dell'Aringa
pixelmech at yahoo.com
Thu Jun 17 10:18:32 CDT 2004
--- Rob Smith <rob.smith at THERMON.com> wrote:
> Try this query instead:
> mysql_query("INSERT INTO scouting (playerID, report) VALUES ('" . $pid .
> "','" . $scout . "')");
Failed :/. Again, I get absolutely nothing - no error just my page back with no result. I moved
the DB stuff into the file and now I have this:
# DATABASE VARIABLES
# HOST NAME OR SERVER ADDRESS
$hostname = "localhost";
# MySQL USERNAME
$dbusername = "****";
# MySQL PASSWORD
$dbpassword = "****";
# DATABASE NAME
$dbname = "****";
$conn = mysql_connect($hostname, $dbusername, $dbpassword);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
$scout = $_POST['scoutReport'];
$pid = $_POST['pid'];
mysql_query("INSERT INTO scouting (playerID, report) VALUES ('" . $pid .
"','" . $scout . "')", $conn);
Seems like it should work especially since I get no error! Isn't there something where you add an
"@" to mysql_query that gave you some info? How can I get more information on what is happening
here?
Thanks
Tom
=====
http://www.Pixelmech.com/ - read my latest blog posting!
John 3:16
More information about the thelist
mailing list