
What is your table structure? run *DESC Customers;* and paste results here. Running apache? What are the logs saying? Benjamin Mutinda Tech Savvy, Cell: 0729- 639 136 * * On Fri, Jul 26, 2013.at 3:13 PM, <skunkworks-request@lists.my.co.ke> wrote:
Send skunkworks mailing list submissions to skunkworks@lists.my.co.ke
To subscribe or unsubscribe via the World Wide Web, visit http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks or, via email, send a message with subject or body 'help' to skunkworks-request@lists.my.co.ke
You can reach the person managing the list at skunkworks-owner@lists.my.co.ke
When replying, please edit your Subject line so it is more specific than "Re: Contents of skunkworks digest..."
Today's Topics:
1. Re: Practice PHP code thats not working (with no error codes) (Andrew Nduati) 2. Re: New traffic light at uhuru haile selassie rdabt (Michael Bullut) 3. Re: skunkworks Digest, Vol 41, Issue 258 (Josephine K. Irungu)
----------------------------------------------------------------------
Message: 1 Date: Fri, 26 Jul 2013 13:09:47 +0100 From: Andrew Nduati <nduatiandrew@gmail.com> To: Skunkworks Mailing List <skunkworks@lists.my.co.ke> Subject: Re: [Skunkworks] Practice PHP code thats not working (with no error codes) Message-ID: < CAPnj2rBuSRDfOHpoaaFnM0Y6q_cv2RoU+RakMCM2bN8C4PY6Ng@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1"
Thanks for the response. The problem is still the same. I've just tried getting rid of the second echo but all I get is a blank screen. And I've confirmed that the DB has records.
On Fri, Jul 26, 2013 at 1:00 PM, Eugene Maritim < kiprotich.maritim@gmail.com
wrote:
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
_______________________________________________ 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