Howdy,
I'm a two day old php/mysql user. I'm trying to write a simple INSERT script. I don't receive any errors, however the query fails. I've tried many different forms of the query but haven't found the one that works. SELECT query works fine. My code is next and below is the output I receive. Any advice is appreciated.
Thanks
Dougman
<?php
include 'library/config.php'; //db account info
include 'library/opendb.php'; //assigns $dbhandle with mysql_connect
$dbquery = "INSERT INTO 'USERS' (userID,email,pass) VALUES ('coded1', 'code@code.com', 'pswd')";
$dbresult = mysql_query ($dbquery, $dbhandle);
if ($dbresult == false)
{
echo "Unable to to perform query<br>";
}
$dbquery = "SELECT * FROM `USERS` LIMIT 0, 30 ";
$dbresult = mysql_query ($dbquery, $dbhandle);
while ($dbrow = mysql_fetch_array($dbresult, MYSQL_ASSOC))
{
print_r($dbrow);
echo '<br>';
}
mysql_close($dbhandle);
?>
*************************************************
Unable to to perform query
Array ( [userID] => manual [email] => crap [pass] => pass )
Array ( [userID] => user2 [email] => email3@email.com [pass] => password2 )
Array ( [userID] => user3 [email] => email3@email.com [pass] => password3 )
Array ( [userID] => hahahha [email] => hahhaha [pass] => hahahaha )
Array ( [userID] => jajja [email] => kakakak [pass] => kakakak )
Array ( [userID] => tripp [email] => ha@ha.com [pass] => password )