I need to send the data gathered from a web form to my database. The connection works, and I can use the data gathered from post to make a query statement that works when used in mysql directly. My php script fails when I call the mysql_query() function. No error is displayed despite having the conditional right after it. My code:
<?phpini_set ("display_errors", "1");error_reporting(E_ALL); $connection=mysqli_connect(/* not shown */); if (mysqli_connect_errno()) { echo "Failed to connect to database: " . mysqli_connect_error(); } $_clubName = $_POST['clubname']; $_clubRep = $_POST['clubrep']; $_meetingID = $_POST['meeting_id']; $_query = "UPDATE oh_checkin_2015 SET clubrep = '$_clubRep', meeting_2 = $_meetingID WHERE clubname = '$_clubName'"; $_result = mysql_query($_query); if (!$_result) die ("Database query failed: " . mysql _error()); else {echo 'successful query';}?>
I have tried my best to locate the problem on my own and have looked up many other forums for a possible solution. If anyone can help me out with this, it would be greatly appreciated.