I am trying to do the following:
A user type his name in a textbox, and press the submit button.
Then, another file checks if the name exist in the database. if it does, the code will select the id from the database where the username is (SELECT id from username where username='$textboxvalue')
This is the code I am using:
CODE
<?php
session_start();
require "database.php";
$to=$_POST['message_to'];
$ck_reciever = mysql_query("SELECT username FROM user WHERE username = '".$to."'");
$to_id = mysql_query("SELECT id FROM user WHERE username = '".$to."'");
die($to_id ."<br>".$ck_reciever."<br>".$to);
?>
session_start();
require "database.php";
$to=$_POST['message_to'];
$ck_reciever = mysql_query("SELECT username FROM user WHERE username = '".$to."'");
$to_id = mysql_query("SELECT id FROM user WHERE username = '".$to."'");
die($to_id ."<br>".$ck_reciever."<br>".$to);
?>
but when i try to echo all these variables (die(blabla))this is what I get:
QUOTE
Resource id #5
Resource id #4
feelay
Resource id #4
feelay
anyone who knows what might be wrong?
Thanks //Feelay


