Web Wiz
Home
Home
Hosting Services
Hosting Services
Knowledgebase
Knowledgebase
Community and Support Forums
Support Forums
Customer Login
Customer Login

  New Posts New Posts RSS Feed - Loop or different way?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Windows Web Hosting 30 Day Free Trial

Windows Web Hosting 30 Day Free Trial

Windows Hosting 30 Day Free Trial, with no obligation, on all our Windows Web and Reseller Hosting Packages.

For moreĀ informationĀ see our Windows Hosting 30 Day Free Trial page.

Loop or different way?

 Post Reply Post Reply
Author
ctytrungloi View Drop Down
Newbie
Newbie


Joined: 09 December 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote ctytrungloi Quote  Post ReplyReply Direct Link To This Post Topic: Loop or different way?
    Posted: 16 February 2009 at 6:43am
Hi all,
I post on MySQL forum but no one answer
http://forums.devshed.com/mysql-help-4/loop-or-different-way-590979.html
 nha khoa. com/showthread.php?t=23423
I'm quite unsore how to proceed with following task:
Lets assume I generated array with numbers (3456, 3333, 1234, 1114).

Now I would like to ask DBA by sql what names are attached for IDs mentioned in array.

The question is how gid data form DBA. Should I insert the Select statement into FOR loop? = 4x select .... where id=$number[$i]???

or

just select all records from DBA and compare the IDs by php code?

Regards and thx for help
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Poole, England
Status: Offline
Points: 8028
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 16 February 2009 at 9:25am
No best way is to use SQL to get just the ids you want:-

WHERE ID= first_number OR ID = second_number, etc.
Back to Top
louis2609 View Drop Down
Newbie
Newbie


Joined: 01 September 2011
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote louis2609 Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2011 at 4:50am
Originally posted by ctytrungloi ctytrungloi wrote:

Hi all,
I post on MySQL forum but no one answer
http://forums.devshed.com/mysql-help-4/loop-or-different-way-590979. - http://forums.devshed.com/mysql-help-4/loop-or-different-way-590979.html
nha khoa. com/showthread.php?t=23423
I'm quite unsore how to proceed with following task:
Lets assume I generated array with numbers (3456, 3333, 1234, 1114).

Now I would like to ask DBA by sql what names are attached for IDs mentioned in array.

The question is how gid data form DBA. Should I insert the Select statement into FOR loop? = 4x select .... where id=$number[$i]???

or

just select all records from DBA and compare the IDs by php code?

Regards and thx for help


Well, you can go to SQL and adjust the IDs. Then it will be ok


Edited by louis2609 - 01 September 2011 at 5:00am
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



Become a Fan on Facebook Follow us on Twitter Web Wiz on Google+ Community Forums Web Wiz Blogs Web Wiz News
Company Information | Contact Web Wiz | Terms & Conditions | Privacy Policy

Prices exclude VAT unless otherwise stated - $, € prices shown as a guideline only
Web Wiz Ltd, Unit 10E Dawkins Road Ind. Est, Poole, Dorset, UK, BH15 4JD
Copyright ©2001-2012 Web Wiz - All rights reserved