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 * :-)


Cheers
Jon


-----Original Message-----
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2001 15:55
To: '[EMAIL PROTECTED]'
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);

<?php

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

<snip>

Any help would be gratefully apreciated!

Kind Regards

Tarrant Costelloe (Taz)

-- 
PHP General Mailing List (http://www.php.net/)
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