SA-MP Forums Archive
PHP + Mysql help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PHP + Mysql help (/showthread.php?tid=453788)



PHP + Mysql help - thimo - 26.07.2013

I dont know if i can post this here but:
Okay im trying to get the id from the database and set the link to that ID
this is what i got:
PHP код:
        $sql "SELECT * FROM Clubs"
        
$rs_result mysql_query ($sql,$connection); 
        
$id mysql_fetch_row($sql$connection);
        
$totalIds $row[0]; 
This is the thing i am using in the table:
PHP код:
        <td><? echo "<a href='Clubs.php?id=".$TotalIds."'>" $row["Name"] . "</a>"?></td>
But im getting this warning:
Код:
Warning: mysql_fetch_row() expects parameter 1 to be resource, string given in /home/ws02775/public_html/Clubs.php on line 57



Re: PHP + Mysql help - IstuntmanI - 26.07.2013

Change
PHP код:
$sql "SELECT * FROM Clubs";
$rs_result mysql_query ($sql,$connection);
$id mysql_fetch_row($sql$connection);
$totalIds $row[0]; 
with
PHP код:
$rs_result mysql_query ("SELECT * FROM Clubs",$connection);
$row mysql_fetch_row($rs_result$connection);
$totalIds $row[0]; 
Also, this is not a forum for PHP help.

EDIT: I don't think this will do what you wanted.