I'll use this script and it works well locall on my Apache server.
<html>
<body link="#060A77" vlink="#060A77" alink="#060A77">
<style type="text/css">
body
{
background-image:
url("images/background.gif");
background-repeat:
no-repeat;
background-position:
right bottom;
background-attachment:
fixed;
}</style>
<style>
BODY{
scrollbar-face-color:#FFFFFF;
scrollbar-shadow-color:#FFFFFF;
scrollbar-highlight-color:#FFFFFF;
scrollbar-3dlight-color:#060A77;
scrollbar-track-color:#CDDFEF ;
}</style>
<?php
$db = mysql_connect("domain", "username", "password");
mysql_select_db("BMW",$db);
$result = mysql_query("SELECT * FROM `autos` WHERE 1",$db);
while ($myrow = mysql_fetch_row($result)) {
echo"<center><table width='95%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='12%' rowspan='2'><a href='detail.php?ID=";printf($myrow[0]);echo"'><img src='autos/";printf($myrow[4]);echo".jpg'width='150' height='100' border=1 alt='Klik hier voor meer info...'></a></td>
<td width='5%' border = 0 bgcolor='#060A77'><strong></strong></td>
<td width='40%' border = 0 bgcolor='#060A77'><strong><font color='#FFFFFF' size='2' face='Arial, Helvetica, sans-serif'>";printf($myrow[1]); echo"</font></strong></b></td>
<td width='300' border= 0 bgcolor='#060A77'><font color='#FFFFFF' size='2' face='Arial, Helvetica, sans-serif'>Prijs: € ";printf($myrow[9]);echo",-
</font></td>
</tr>
<tr>
<td><p> </p></td></b>
<td colspan='2'><p><font size='2' face='Arial, Helvetica, sans-serif'>Bouwjaar: ";printf($myrow[3]);echo"<br>
Kilometerstand: ";printf($myrow[11]);echo"</p>
<p><a href='detail.php?ID=";printf($myrow[0]);echo"' >Meer info...</a></p></td></font>
</tr>
</table><p></center>";
}
?>
</body>
</html>
Every time i'll get this error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /www/htdocs/heeresau/test.php on line 34
Row 34 is this row:
while ($myrow = mysql_fetch_row($result)) {
But locall on my pc it works great !, and if i send the SQL query with phpmyadmin then it works... so why not now ? do i'll need to change the SQL query or can i use another command to get my data from the Mysql database ?
What do u use to get data from your database ?
Please help....