Web Wiz - Solar Powered Eco Web Hosting

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

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: Bournemouth
Status: Offline
Points: 9791
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

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.