![]() |
| ||
| Explode and Post doesn't seem to work together Hi (In my php form, i'm getting a bunch of data to Mysql, all of which is working correctly except id and name. id and name are fed from Mysql to the form.) Here's the problem area: I'm getting an id AND name from a dropdown menu using EXPLODE. With this code, all columns are fed correctly to Mysql EXCEPT sid and Student: ('$_POST[Teacher]','$_POST[sid]','$_POST[Student]','$_POST[Date]','$_POST[Tardy]','$_POST[Comment]','$_POST[Absent]','$_POST[Inhouse]','$_POST[Suspension]','$_POST[Allpresent]')";With the code above, this is what's submitted to MYsql:sid column is blank. Student column has id AND Student with pipe inbetween (ex: 468|Grundy Joe) When i use this code: ('$_POST[Teacher]','$sid,'$student','$_POST[Date]','$_POST[Tardy]','$_POST[Comment]','$_POST[Absent]','$_POST[Inhouse]','$_POST[Suspension]','$_POST[Allpresent]')";With the code above, this is what's submitted to MYsql:sid column and Student columns are blank. Here is the complete action code: <html><a href="http://10.49.5.99/">Home </a><br><br> Can anybody see where i goofed up the code? Thanks, Mike |
| ||
| Re: Explode and Post doesn't seem to work together Where do you set the variable $tardy in your code? |
| ||
| Re: Explode and Post doesn't seem to work together OH JEEZE, I had to leave and didn't have time to check it. I'm sorry. &tardy should be $student. I'm such a dummy |
| ||
| Re: Explode and Post doesn't seem to work together I have the correct code on my computer, but doesn't work properly as noted above. |
| ||
| Re: Explode and Post doesn't seem to work together Hii... post your complete code.. also your main html code in here.... coz it will give us more clear idea about how the thing is working... |
| ||
| Re: Explode and Post doesn't seem to work together Here's the form code (to-web.php): <html> Here's the action code (incoming.php): <html><a href="http://10.49.5.99/">Home </a><br><br> Thanks, Mike |
| ||
| Re: Explode and Post doesn't seem to work together Hey.. in incoming.php file... make sure that the explode is not called after the insert query.. Because in the code you pasted above.. it seems to be that explode is called after the $sid and $student are assigned to query.. put explode and $sid=$part[0]..... statement before $sql insert query statement... Then check again.. |
| ||
| Re: Explode and Post doesn't seem to work together It didn't make a difference. <html><a href="http://10.49.5.99/">Home </a><br><br> I made another database and forms to debug with. and when i use ($sid','$','$student',) by themselves, it posts id and student to Mysql, just like it's supposed to: Thanks, Mike |
| ||
| Re: Explode and Post doesn't seem to work together Hi.. tried to find out the error in your code... i could not find any problem... if possible try to debug your code by using stub variables to display the intermediate values... so that you will know till wt point the values are coming correctly.. and you might reach to the trouble point in this way.. |
| ||
| Re: Explode and Post doesn't seem to work together Ok, I'll try that. Thanks for taking the time to look at it. Mike |
| All times are GMT -4. The time now is 10:57 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC