Jump to content

haditedi

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

haditedi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. After all day ,,,wondering and pondering ,,, finally the good God shows the way ,,, I tried the code from <? to <?php and it works nowww!!! but still dont know the reason behind this though,,,,,
  2. Thx for the reply Thorpe but still wont work,,, before my error was "mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\carpark\viewcars.php on line 21" now it changed to mysql_num_rows() expects parameter 1 to be resource, boolean,,,,,
  3. Hi All, pls help me with this I have include a 'connect.php' but it resulted error "mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\carpark\viewcars.php on line 21" but if I dont use php include then everything works fine,,, below the code : <?php include "connect.php"; echo "<table border='1' id='position'> <tr> <th>Ticket</th> <th>Car Name</th> <th>Car Out</th> </tr>"; $result=mysql_query("select * from car"); while ($row=mysql_fetch_array($result)) { echo "<tr>"; echo "<td>".$row['ticket']."</td>"; echo "<td>".$row['carname']."</td>"; echo "</tr>"; } echo "</table>"; mysql_close(); ?> connect.php <? $host="localhost"; $user="root"; $password=""; mysql_connect($host,$user,$password); mysql_select_db("car"); ?> If I use below ,,everything works fine ... what went wrong ??? <? $host="localhost"; $user="root"; $password=""; mysql_connect($host,$user,$password); mysql_select_db("car"); echo "<table border='1' id='position'> <tr> <th>Ticket</th> <th>Car Name</th> <th>Car Out</th> </tr>"; $result=mysql_query("select * from car"); while ($row=mysql_fetch_array($result)) { echo "<tr>"; echo "<td>".$row['ticket']."</td>"; echo "<td>".$row['carname']."</td>"; echo "</tr>"; } echo "</table>"; mysql_close(); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.