• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 746
  • Last Modified:

MySql and php - select all rows

Hi E's, I want to know how I select all rows in the table.
Usually I use this with php:
$info_result = mysql_query("SELECT * FROM tablex where id > 0 ", $db); 

Open in new window

That work, but I thing have a more correct way for select all rows in the table.
Can you show me please?

The best regards, JC
0
Pedro Chagas
Asked:
Pedro Chagas
  • 2
3 Solutions
 
K VDatabase ConsultantCommented:
I don't think you need "where id > 0"
+
Instead of
 SELECT * FROM tablex
try specifying column names which you need:
 SELECT col1,col2... FROM tablex
0
 
Loganathan NatarajanLAMP DeveloperCommented:
just try it,

$info_result = mysql_query("SELECT * FROM tablex ", $db);

:)
0
 
Loganathan NatarajanLAMP DeveloperCommented:
0
 
Pedro ChagasWebmasterAuthor Commented:
Please, don't post more solutions.
I have to test this ones more later.
~JC
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now