Jump to content

sending visitors to an error page


webdeveloper123
Go to solution Solved by benanamen,

Recommended Posts

9 minutes ago, cyberRobot said:

First, I should mention I'm with requinix about NOT needing to pull in every customer ID.

Surprised you are saying that. It makes no sense to select the ENTIRE database table when all you want is to edit one SPECIFIC Id record.

Edited by benanamen
Link to comment
Share on other sites

6 minutes ago, benanamen said:

Surprised you are saying that. It makes no sense to select the ENTIRE database when all you want is to edit a SPECIFIC Id.

No we're saying the same thing. The OP doesn't need all the entries.

EDIT: I modified my post to hopefully make that clearer.

  • Like 1
Link to comment
Share on other sites

Just now, cyberRobot said:

No we're saying the same thing. The OP doesn't need all the entries.

Ok, I agree. @requinix was saying the same thing.

1 hour ago, requinix said:

If you have an ID and want to make sure it exists then what you do is execute a query to see if there are rows matching that ID. You do not retrieve every single one. That's terribly, terribly inefficient.

Link to comment
Share on other sites

I said

$sql = "SELECT id FROM yourTable";

instead of

$sql = "SELECT * FROM yourTable";

But I guess what I REALLY should post is

$sql = "SELECT id FROM yourTable WHERE id = $yourValue ";

I think it would have been more helpful (especially to the initial poster) if @benanamen would have shown the correction as a way to advance progress to a solution

Edited by phppup
Link to comment
Share on other sites

9 minutes ago, phppup said:

I think it would have been more helpful (especially to the initial poster) if @benanamen would have shown the correction as a way to advance progress to a solution

You obviously haven't read the whole thread. I showed EXACTLY that.
https://forums.phpfreaks.com/topic/315071-sending-visitors-to-an-error-page/?do=findComment&comment=1598471

And at no point in this thread was there ever any mention of SELECT * so there is no "instead of", but now it is just pointless arguing. OP has been given the solution.

 

Edited by benanamen
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.