Hey!

Find edited code below:
    1. Swapped the order params of mysql_select
    2. Changed mysql_select.db to mysql_select_db

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php


//SQL Part
$host="localhost";
$username="root";
$password="";


$conn= mysql_connect($host,$username,$password) or exit("Connection Error".mysql_error());

mysql_select_db('sample') or exit("Database not found");

//Data from the query is stored in $result
$result = mysql_query("SELECT * FROM profiles", $conn);

while($row = mysql_fetch_array($result))
  {
  echo $row['CustomerName'] . " " . $row['ContactName'];
  echo "<br>";
  }
  mysql_close($conn);
  ?>
</body>
</html>



On Fri, Jul 26, 2013 at 2:46 PM, Andrew Nduati <nduatiandrew@gmail.com> wrote:
Good Afternoon Skunks,
        Below is my PHP code that is meant to run an SQL Select query however it doesn't seem to be working. All I'm getting when I open it in the browser ("; } mysql_close($con); ?> ")
Please assist.
Kind regards.



<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php


//SQL Part
$host="localhost";
$username="root";
$password="*****";


$conn= mysql_connect($host,$username,$password) or exit("Connection Error".mysql_error());

mysql_select.db('sample') or exit("Database not found");

//Data from the query is stored in $result
$result = mysql_query($conn,"SELECT * FROM Customers");

while($row = mysql_fetch_array($result))
  {
  echo $row['CustomerName'] . " " . $row['ContactName'];
  echo "<br>";
  }
  mysql_close($conn);
  ?>
</body>
</html>

_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke