PHP Form not inserting into database :(

I have a simple post status page that works when posting the status, but I have tried to add a drop down menu so the user can select a category to filter the posts, but the category isn’t posting in my mysql database.

Here is the drop down code
[php]

Select Category Art Music Sport
[/php]

And here is the entire code for the page
[php]<?php
$status_ui = “”;
$statuslist = “”;
if($isOwner == “yes”){
$status_ui = ‘’;
$status_ui .= ‘Post’;
} else if($isFriend == true && $log_username != $u){
$status_ui = ‘’;
$status_ui .= ‘Post’;
}
?><?php
$sql = “SELECT s.*, u.avatar
FROM status AS s
LEFT JOIN users AS u ON u.username = s.author
WHERE (s.account_name = ‘$u’ AND s.type=‘a’)
OR (s.account_name= ‘$u’ AND s.type=‘c’)
ORDER BY s.postdate DESC LIMIT 20”;

$query = mysqli_query($db_conx, $sql);
$statusnumrows = mysqli_num_rows($query);
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$statusid = $row[“id”];
$account_name = $row[“account_name”];
$author = $row[“author”];
$postdate = $row[“postdate”];
//
$avatar = $row[“avatar”];
$user_image = ‘’;
//
$category = $row[“category”];
$data = $row[“data”];
$data = nl2br($data);
$data = str_replace("&","&",$data);
$data = stripslashes($data);
$statusDeleteButton = ‘’;
if($author == $log_username || $account_name == $log_username ){
$statusDeleteButton = 'delete status    ';
}
// GATHER UP ANY STATUS REPLIES
$status_replies = “”;
$sql2 = “SELECT s.*, u.avatar
FROM status AS s
LEFT JOIN users AS u ON u.username = s.author
WHERE s.osid = ‘$statusid’
AND s.type= ‘b’
ORDER BY postdate ASC”;

$query_replies = mysqli_query($db_conx, $sql2);			
$replynumrows = mysqli_num_rows($query_replies);
if($replynumrows > 0){
    while ($row2 = mysqli_fetch_array($query_replies, MYSQLI_ASSOC)) {
		$statusreplyid = $row2["id"];
		$replyauthor = $row2["author"];
		$replydata = $row2["data"];

//
$avatar2 = $row2[“avatar”];
$user_image2 = ‘’;
//
$replydata = nl2br($replydata);
$replypostdate = $row2[“postdate”];
$replydata = str_replace("&","&",$replydata);
$replydata = stripslashes($replydata);
$replyDeleteButton = ‘’;
if($replyauthor == $log_username || $account_name == $log_username ){
$replyDeleteButton = ‘remove’;
}
$status_replies .= ‘

Reply by ‘.$replyauthor.’ ‘.$replypostdate.’: ‘.$replyDeleteButton.’
‘.$user_image2.’
’.$replydata.’
’;
}
}
$statuslist .= ‘
Posted by ‘.$author.’ ‘.$postdate.’: ‘.$statusDeleteButton.’
‘.$user_image.’
’.$data.’
’.$status_replies.’
’;
if($isFriend == true || $log_username == $u){
$statuslist .= ‘Reply’;
}
}
?>
Select Category Art Music Sport
<?php echo $status_ui; ?>
<?php echo $statuslist; ?>
[/php]

Thanks any help appreciated, I am still learning this >_<

your category needs a name.
<select id=“category” name=“category”>

Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service