Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[PHP] Help Grabbing From 2 tables [MySql]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="RastaLulz" data-source="post: 359027" data-attributes="member: 1"><p>For one, you shouldn't be using mysql_* functions; it's depreciated as of PHP 5.5, and removed in PHP 7.</p><p></p><p>Anyways, what's the point of $query1? You should already have that information from the initial query?</p><p></p><p>You could accomplish what you're doing with just one query:</p><p>[CODE]SELECT u.figure, u.username, u.groupid, u.rank, j.name</p><p>FROM users AS u</p><p>INNER JOIN jobs AS j</p><p>ON j.jobid = u.groupid</p><p>WHERE u.groupid = ?</p><p>ORDER BY u.jobrank DESC[/CODE]</p></blockquote><p></p>
[QUOTE="RastaLulz, post: 359027, member: 1"] For one, you shouldn't be using mysql_* functions; it's depreciated as of PHP 5.5, and removed in PHP 7. Anyways, what's the point of $query1? You should already have that information from the initial query? You could accomplish what you're doing with just one query: [CODE]SELECT u.figure, u.username, u.groupid, u.rank, j.name FROM users AS u INNER JOIN jobs AS j ON j.jobid = u.groupid WHERE u.groupid = ? ORDER BY u.jobrank DESC[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP] Help Grabbing From 2 tables [MySql]
Top