Jump to content

<select> form help


unsider

Recommended Posts

I'm having trouble inputting my <select> form data into the database. I've run checks if it has been set, etc.. made sure i didn't mis-type, and everything else, except the <select> data is being updated. It's frustrating because I can't find a single tutorial on inputing <select> data into a DB, so I can't double check.

 

This is really annoying me, i have no idea why it isn't working.

 

<select> form

<select name="cat">
<option value="-1" selected="selected">&nbsp</option>
<option value="1">test</option>
<option value="2">test</option>
<option value="3">test</option>
<option value="4">test</option>
<option value="5">test</option>
</select>

 

All of my code is functional, but I'm wondering if anyone can look at my <select> form, and show me an example of a simple <select> input, or point me towards a tutorial, that involves using a database.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/115272-form-help/
Share on other sites

I know, it's weird, I validate to see if it's set...

 

$retval = $session->tutorial($_POST['title'], $_POST['body'], isset($_POST['cat']));

 

Then I do it again so I can potientally catch an error..

 

if(!....

 

then i insert if it all passes

 

$q = "INSERT INTO ".TBL_TUTORIALS." VALUES (' ', '$cat', '$author', NOW(), NOW(), '$title', '$body')";

 

It doesn't make sense why it's not updating the value, the NULL value is 0, but the value in the DB is '1', and no matter what I do, it won't update. *sigh*

 

Link to comment
https://forums.phpfreaks.com/topic/115272-form-help/#findComment-592632
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.