[SOLVED]ok..im confused..
Posted: Mon Jul 10, 2006 4:29 pm
ok so ive been having sme problem with an AIM boit im wirting.....
works fine, but this will allow a user to add an existing user....
so heres what i tried
so i tried this... if i try to have it add someone thats allready in the database, it tells me that and continues with no problems....
if i try to add someone that isnt in the database it outputs nothing, no errors, and dies.....
this is being run through the php console and before someone asks
Code: Select all
$sql_insert = mysql_query("INSERT INTO buddies SET name='" . $checkmsg[1] . "'");
if($sql_insert)
{
$this->send_im($args['user'], "<font face='Verdana' size=1 color='#006699'>" . $checkmsg[1] . " was successfully added to our database, you will be able to check " . $checkmsg[1] . "'s buddyinfo within fifteen minutes.</font>");
}
else
{
$dberrormsgtosend = "<font face='Verdana' size=1 color='#006699'>There is currently a problem with our database, please try again soon.</font>";
$this->send_im($args['user'], $dberrormsgtosend);
}so heres what i tried
Code: Select all
$isindb = mysql_fetch_row(mysql_query("SELECT * FROM buddies WHERE name='{$checkmsg[1]}'")) or die(mysql_error());
if($isindb != 0){$this->send_im($args['user'], "<font face='Verdana' size=1 color='#006699'>That user is allready in the Database!</font>");}
elseif($isindb == 0) {
$sql_insert = mysql_query("INSERT INTO buddies SET name='" . $checkmsg[1] . "'");
if($sql_insert)
{
$this->send_im($args['user'], "<font face='Verdana' size=1 color='#006699'>" . $checkmsg[1] . " was successfully added to our database, you will be able to check " . $checkmsg[1] . "'s buddyinfo within fifteen minutes.</font>");
}
else
{
$dberrormsgtosend = "<font face='Verdana' size=1 color='#006699'>There is currently a problem with our database, please try again soon.</font>";
$this->send_im($args['user'], $dberrormsgtosend);
}
}so i tried this... if i try to have it add someone thats allready in the database, it tells me that and continues with no problems....
if i try to add someone that isnt in the database it outputs nothing, no errors, and dies.....
this is being run through the php console and before someone asks
Code: Select all
PHP Version: 5.1.4
PHP OS: WINNT
Error Reporting: 2039 (E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_WARNING | E_ERROR)
Register Globals: Off
Short Tags: Off
Display Errors: On
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp hash iconv
odbc pcre Reflection session
libxml standard tokenizer zlib
SimpleXML dom SPL wddx
xml xmlreader xmlwriter apache2handler
curl gd gettext imap
mbstring exif mime_magic ming
mssql mysql mysqli openssl
pdf PDO pdo_mssql pdo_mysql
soap sockets SQLite xmlrpc
xsl zip Zend Optimizer