last day (14 days later) » 

3:28 AM
1
A: Mupdate sql query retur an error: limit 1

Fred -ii-I think I know where the problem is. You need to use the multi_query() function. Try this: if(!$connection->multi_query($query)){ echo "Multi query failed: (" . $connection->errno . ") " . $connection->error; } instead of $result = mysqli_query($connection, $query); Edit Try this method...

 
thank's for the time it return this error: Database connection failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' transaction = '', flemingia = , goat_manual = , lbc_tracking_no = , visible = ' at line 1
 
You're welcome @jhunlio I'm curious about this function find_order_by_id() is there anything being echo'ed in your form with value="<?php echo $current_order_id["menu_name"]; ?>"? Where is that function located and what's in it?
I think I know where the problem is. You need to use multi_query() try this if(!$connection->multi_query($query))echo "Multi query failed: (" . $connection->errno . ") " . $connection->error;} instead of $result = mysqli_query($connection, $query); @jhunlio
 
ok i try your suggestion thanks i will get back after i try
 
I placed it on top of my answer in an edit. @jhunlio Crossing my fingers.
 
i post all of my function in my update @Fred -ii- also i change $result = mysqli_query($connection, $query); to this if(!$connection->multi_query($query)) echo "Multi query failed: (" . $connection->errno . ") " . $connection->error;} it return this error:Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\exercises\exercise3\public\edit_order.php on line 32, I think that because of close bracket(})
 
3:28 AM
My mistake I forgot a { I edited my answer with if(!$connection->multi_query($query)){ echo "Multi query failed: (" . $connection->errno . ") " . $connection->error;} @jhunlio
hi
 
thank's fred but it return this error: Multi query failed: (1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' transaction = '', flemingia = , goat_manual = , lbc_tracking_no = , visible = ' at line 1
 
by using if(!$connection->multi_query($query)){ echo "Multi query failed: (" . $connection->errno . ") " . $connection->error;} ?
 
so what that mean?
 
I have no idea my friend. When you're using value="<?php echo $current_order_id["menu_name"]; ?>" is there anything being echo'ed in that field and the others?
 
yes... it echo the current info of that input field
 
3:32 AM
I'm very very baffled by all this.
 
it display back the info from database in that row...
sorry for all trouble maybe i need to find other solution for this kind of problem thank you so much in giving time in my question many many thanks... :)
 
Yet I think you're calling your function for all the $current_order_id values in your form, and that's what I think is wrong. I suggest that you remove all your values for those in a "TEST" file
each time it's calling the function, it's also calling MySQL to do a query
and just use the $_POST variables
 
if you familiar with lynda.com tutorials that's the one I follow, and it work great in there but when i decide to make it in my own it turn this problem :(
 
Oh Lord... yes I am familiar with Lynda.com and have heard some horror stories about it, sorry to say.
I suggest you make a few TEST files without the function and try inserting into DB using just the $_POST variables and multi_query()
once that works, you can slowly start integrating your function back into it
try it on a smaller scale first
your find_order_by_id() should also be using multi_query()
 
ok sure.. I try it... thank you for your support and time
 
3:41 AM
you're welcome.
 
I guess you deserve to have an UP vote
 
it's ok, you don't have to
 

last day (14 days later) »