sliperypete Posted November 28, 2006 Author Share Posted November 28, 2006 I got rid of that else statement, so now when I go to the page it doesnt display that message.But now when I click close I dont get the:[color=red][font=Verdana]The ticket is now closed good work![/font][/color]messageSomething is wrong with that update query and I have been staring at it for days with no idea... Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131455 Share on other sites More sharing options...
fiddy Posted November 28, 2006 Share Posted November 28, 2006 friend can you pls put print_t($_POST); at the top of the page and tell me what you get before cliking close and after clicking close buttom Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131461 Share on other sites More sharing options...
fiddy Posted November 28, 2006 Share Posted November 28, 2006 Sorry thats print_r($_POST); Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131463 Share on other sites More sharing options...
sliperypete Posted November 28, 2006 Author Share Posted November 28, 2006 Before hitting close:Array ( ) After:Array ( [status] => 0 [solution] => I FIXED IT ) Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131466 Share on other sites More sharing options...
fiddy Posted November 28, 2006 Share Posted November 28, 2006 So this is the problem.<input type="submit" value="submit">give a name for the submit button<input type="submit" value="submit" name="submit"> Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131474 Share on other sites More sharing options...
sliperypete Posted November 28, 2006 Author Share Posted November 28, 2006 OK that fixed it so that it runs through the insert process, but now I get the message:The ticket is now closed good work!But the data doesnt get inserted into the DB Here is the insert query again....[code]$status = $_POST['status'];$solution = $_POST['solution'];if(isset($_POST['submit'])){ mysql_query ("UPDATE ticket SET status='$status',solution='$solution' WHERE ticket_id='$ticketid'") or die(mysql_error()); echo "The ticket is now closed good work!";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131543 Share on other sites More sharing options...
sliperypete Posted November 28, 2006 Author Share Posted November 28, 2006 It has to be something with the WHERE clause, do you guys see anything ?? Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131565 Share on other sites More sharing options...
sliperypete Posted November 28, 2006 Author Share Posted November 28, 2006 In this part of the statement WHERE ticket_id='$ticketid'") am I aloud to do a WHERE clause with a php variable in it $ticketid is a PHP variable passed from the previous page. Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131644 Share on other sites More sharing options...
fiddy Posted November 29, 2006 Share Posted November 29, 2006 try like this also echo the $sql and see if the sql is correct$sql=UPDATE ticket SET status='$status',solution='".$solution."' WHERE ticket_id='".$ticketid."'"mysql_query ($sql) or die (mysql_error()); Link to comment https://forums.phpfreaks.com/topic/28703-phpmysql-problem/page/2/#findComment-131956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.