20.09.2010, 16:17
Hey everybody.
I don't know if this is the correct section here, (i even guess it's the wrong forum, but i don't want to be registered on every shitty forum on the world) but i have a question according php-coding.
When I try to check the values i get from my mysql_database, it gives me a weird error. I tried to ****** it but i did not find anything that helped me somehow. Here my code:
It gives me following error:
In line:
The saving in arrays actually works, i tried this in my code before, so this does not cause the problem (i guess).
I hope anybody has enough knowledge in php to help me with my problem, because i am actually totally bad in coding php =P.
Thanks.
I don't know if this is the correct section here, (i even guess it's the wrong forum, but i don't want to be registered on every shitty forum on the world) but i have a question according php-coding.
When I try to check the values i get from my mysql_database, it gives me a weird error. I tried to ****** it but i did not find anything that helped me somehow. Here my code:
PHP Code:
...
$result = mysql_query("SELECT var1,var2 FROM table WHERE ip = '".$rip."'"); //$rip is declared before
$row=mysql_fetch_field($result);
if(mysql_num_rows($result)>0)
{
if($row[0]==1) echo "SINVALID";
else {
if($row[1]==strval(date("H"))) echo "LREACHED";
else {
mysql_query("INSERT INTO(...)");
if(mysql_errno()==0) echo "1";
}
}
}
...
Code:
Fatal error: Cannot use object of type stdClass as array in youdontneedmyurl/bleh.php on line 40
PHP Code:
...
if($row[0]==1) echo "SINVALID";
...
I hope anybody has enough knowledge in php to help me with my problem, because i am actually totally bad in coding php =P.
Thanks.