[GLLUG] Retrieving a row from mysql
Clay Dowling
clay at lazarusid.com
Mon Feb 16 17:38:21 EST 2004
Seth Bembeneck said:
> $name = 'Seth';
> $accnum= 12;
> $tablename = 'players'
> query = mysql_query("SELECT * FROM $tablename WHERE name= '$name' AND
> accountnum= $accnum");
Seth,
K.I.S.S. applies here, if nothing else. Don't try to make the table name
a variable. The only time where that's useful is in some pretty advanced
applications. You're just getting started out, and I highly recommend
that you use as few variables as possible. You must walk before you run
and all that.
Clay Dowling
--
Lazarus Notes from Lazarus Internet Development
http://www.lazarusid.com/notes/
Articles, Reviews and Commentary on web development
More information about the linux-user
mailing list