[Tutorial] PHP + MySQL
#9

PHP код:

$result 
mysql_query("SELECT * FROM users") or die(mysql_error());  // Getting all information (*) from the table users. 
Why would you use this? You're getting all the information for every single player and then making a massive table. More than 100 users would completely lag it.

PHP код:

$query 
"SELECT ID, COUNT(ID) FROM users "// Seems clear, we are getting the amount of ID's and we are getting it FROM the table users. 
Hiddos was right in a previous post. You're selecting the ID and not using it at all.

What you should do is the following
  • Discuss what the CREATE TABLE query does.
  • Discuss what echo actually does
  • Discuss what the row variable actually does and how to access other information using it.
It's not a bad tutorial, but you should put a bit better explanation into it.
Reply


Messages In This Thread
PHP + MySQL - by Kingunit - 19.09.2011, 16:51
Re: PHP + MySQL - by [MWR]Blood - 19.09.2011, 17:09
Re: PHP + MySQL - by Jafet_Macario - 19.09.2011, 17:14
Re: PHP + MySQL - by Fat - 19.09.2011, 17:24
Re: PHP + MySQL - by Kingunit - 19.09.2011, 18:11
Re: PHP + MySQL - by Hiddos - 19.09.2011, 18:34
Re: PHP + MySQL - by Kingunit - 19.09.2011, 18:42
Re: PHP + MySQL - by System64 - 19.09.2011, 19:05
Re: PHP + MySQL - by [HiC]TheKiller - 19.09.2011, 19:42
Re: PHP + MySQL - by Kingunit - 19.09.2011, 19:44

Forum Jump:


Users browsing this thread: 1 Guest(s)