Jump to content

select question


eMonk

Recommended Posts

One of my tables has 28 columns.

 

I'm going to be echoing 9 of the columns in my index file.

 

Which of the following queries would be better to do this as they both work:

 

$query = "SELECT * FROM model";

 

$query = "SELECT column1, column2, column3, column4, .... FROM model";

 

Link to comment
Share on other sites

Guess I'll go with

 

$query = "SELECT column1, column2, column3, column4, .... FROM model";

 

because it makes more sense and just fetches the data I'll be using.

 

The first query is just smaller code so I was wondering which would be better but after some thought I think the second one would be better unless someone else says otherwise.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.