trying to debug a record insertion form for my blog page.
What i want to happen is:
-User Enters their Nickname into a form
-Then I determine the User Id based on this nickname (since they are both in the 'users' table)
-Insert the blog with user id to the 'posts' table
Pretty simple eh? So what am i doing wrong?
Code: Select all
<?php
$username = $HTTP_POST_VARS['nickname'];
$query_1 = "SELECT USER_ID FROM users WHERE NICK_NAME = $username";
$userid = mysql_query($query_1);
?>Thx in advance!