Couple of other tips for you.

1. SELECT * is bad unless you really need every field. If you don't, specify
which ones you want - the query will perform better. 

$s = "SELECT * FROM News"; // bad
$s = "SELECT NewsHeadline, NewsTeaser FROM News"; // better

2. You appear to be connecting to your database (a) as root and (b) without
a password (although you may have modified the code, so I'm not sure). This
is even worse than SELECT * :-)


-----Original Message-----
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2001 15:55
Subject: [PHP] SELECT * FROM

Hello all, 
I have a designing a website of which people can submit news to, this works
fine. Just on the main page I have the following code (snippet);


$db = mysql_connect("localhost", "root");
$result = mysql_query("SELECT * FROM news",$db);


Any help would be gratefully apreciated!

Kind Regards

Tarrant Costelloe (Taz)

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to