Error : Warning: Cannot use a scalar value as an array in /home/a5886547/public_html/main_forum.php on line 74
Code:
$sql5="SELECT MAX(id) AS Maxid FROM forum_question WHERE forums_id='$f_id'"; (line72)
$rows1=mysql_query($sql5); (line73)
i$rows1['Maxid']=$id; (line74)
What is causing the error??
Thank you.
Error !!
Moderator: General Moderators
Re: Error !!
$rows1 is not an array.
Re: Error !!
$sql5="SELECT MAX(id) AS Maxid FROM forum_question WHERE forums_id='$f_id'"; (line72)
$rows1=mysql_query($sql5); (line73)
$row = mysql_fetch_array($rows1); //need to fetch array or association
$row['Maxid']=$id; (line74) //can assign to array, but not to DB
$rows1=mysql_query($sql5); (line73)
$row = mysql_fetch_array($rows1); //need to fetch array or association
$row['Maxid']=$id; (line74) //can assign to array, but not to DB
Re: Error !!
Thank you , lads !
how stupid of me...
BTW , another error : Duplicate entry '1' for key 1 (I guess its from MySQL)
Here is the code :
$sql="INSERT INTO forum_question(forums_id, id, topic, detail, name, email, datetime) VALUES('$f_id', '$id', '$topic', '$detail', '$name', '$email', '$datetime')";
$result=mysql_query($sql) or die(mysql_error());
P.S. None of the fields are auto_increment
how stupid of me...
BTW , another error : Duplicate entry '1' for key 1 (I guess its from MySQL)
Here is the code :
$sql="INSERT INTO forum_question(forums_id, id, topic, detail, name, email, datetime) VALUES('$f_id', '$id', '$topic', '$detail', '$name', '$email', '$datetime')";
$result=mysql_query($sql) or die(mysql_error());
P.S. None of the fields are auto_increment
Re: Error !!
One of your table fields has the unique property set rather than just an index.
Re: Error !!
Thanks , it worked !!