I am trying to code a query whereby the query checks for duplicate items in a table and if found sends an error back to jquery. However, what is happening, is that jquery keeps giving me a typeError and I cannot see why. In my posted code, the code that is commented out, /* if ($box == 'DEMO111') works fine but not my query.
All mysql connections are working and I can connect to the db.
I would be grateful if someone could check my code and show me where I have gone wrong. Thanks
DB Config
<?php
function runSQL($rsql) {
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "logistor_logistor";
$connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database");
$db = mysql_select_db($dbname);
$result = mysql_query($rsql) or die (mysql_error());
return $result;
mysql_close($connect);
?>
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
MySql code help needed
in PHP Coding Help
Posted
I am trying to code a query whereby the query checks for duplicate items in a table and if found sends an error back to jquery. However, what is happening, is that jquery keeps giving me a typeError and I cannot see why. In my posted code, the code that is commented out, /* if ($box == 'DEMO111') works fine but not my query.
All mysql connections are working and I can connect to the db.
I would be grateful if someone could check my code and show me where I have gone wrong. Thanks
DB Config