Jump to content

php / mysql question


Monkuar

Recommended Posts

If it faster to use call all the table using *, or calling each individual row/field?

 

Which is betteR:

 

	$result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error());
	$pun_user = $db->fetch_assoc($result);

 

 

OR

 

	$result = $db->query('SELECT u.id,u.username,u.color,u.star/*ETCETC*ETC*ETC/blablahj....., g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error());
	$pun_user = $db->fetch_assoc($result);

 

Link to comment
https://forums.phpfreaks.com/topic/258222-php-mysql-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.