GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Sep-2004, 06:24
skyloon skyloon is offline
Junior Member
 
Join Date: Jun 2003
Posts: 53
skyloon is an unknown quantity at this point

fetch result


i need to send a message to a receiver, if the user not in the database, echo the "Unknown user", if the user is in the database, then the message will be sent to the receiver
although i use mysql_fetch_row, mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_field, mysql_num_fields, mysql_num_rows
it just shows "Unknown user".....
hope you all can teach me...
thank you..

PHP Code:

$result = mysql_query("SELECT username FROM ".$DBprefix."signup WHERE username='$nickname'") or die(mysql_error()); 
 
if (mysql_fetch_field($result) != $adres) { 
echo"Unknown user";    
} else { 
$datetime = date("Y-m-d G:i:s ");
    $query = mysql_query("INSERT INTO ".$DBprefix."inbox (messageID,adres,sender,DateRecieved,title,message,isRead) values ('','$adres','$nickname','$datetime','$subject','$content','')");
    echo"Your message has been sent to $adres";
} 
} 
$result = mysql_query($query); 


 

Recent GIDBlogPrepping for deployment by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outputting function result to an array Shufty C Programming Language 4 07-May-2004 10:45
help with c++ object assignment Mjkramer21 CPP / C++ Forum 31 14-Apr-2004 18:51
read specified range of lines from file etron C Programming Language 8 18-Feb-2004 08:04
mysql_query result True on first iteration, then False samtediou MySQL / PHP Forum 6 24-Jul-2003 11:49
Show result in table skyloon MySQL / PHP Forum 1 03-Jul-2003 18:30

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:48.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.