Print Page | Close Window

Loop or different way?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26992
Printed Date: 28 March 2026 at 9:26am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Loop or different way?
Posted By: ctytrungloi
Subject: Loop or different way?
Date 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" rel="no follow - http://forums.devshed.com/mysql-help-4/loop-or-different-way-590979.html
  http://www.sieuthi77.com/main/nhakhoa.html" rel="no follow - 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



Replies:
Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: louis2609
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net