Re: whats wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please check this line:
> $result=mysql_query("select("SELECT*FROM COLLEAGUE");

I think it should be:
 > $result=mysql_query("SELECT * FROM COLLEAGUE");

On Sat, Mar 31, 2012 at 1:45 PM, saeed ahmed <mycomputerbooks@xxxxxxxxx>wrote:

> i have made a php script with a tutorial help....i dont know where is a
> error.please have a look
>
>
> <?php
> //connect and select a database
> mysql_connect("localhost","root"," " );
> mysql_select_db("addressbook");
> //Run a query
> $result=mysql_query("select("SELECT*FROM COLLEAGUE");
> ?>
> <!DOCTYPE html PUBLIC"-//w3c//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <title>Address Book</title>
> <meta http-equiv="content-type" content="text/html;charset=utf-8"
> </head>
> <body>
> <h1>Address Book<h1>
> <table Border="1" cellpadding="2"cellspacing="3"
> summary="table holda colleague contacts information">
> <tr>
> <th> ID</th>
> <th>First Name</th>
> <th>Last Name</th>
> <th>Telephone</th>
> <th>Email Address</th>
> </tr>
> <?php
> //LOOP through all table rows
> while ($row=mysql_fetch_array($result)) {
> echo"<tr>";
> echo"<td>".$row['id'] . "</td>;
> echo "<td>" . $row['firstName'] . "</td>";
> echo "<td>" . $row['lastName'] . "</td>";
> echo "<td>" . $row['telephone'] . "</td>";
> echo "<td>" . Srow['email'] . "</td";
> echo"</tr>";
> }
> //free result memory and close database connection
> mysql_free_result($result);
> mysql_close();
> ?>
> </table>
> </body>
> </html>
> thanks
>



-- 
Duken Marga

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux