User CP
Name:  
Pass:

Register
Latest News
- RO2 multi trail...
- Sneak Peak! -D...
- Affiliate News ...
- Affiliate News ...
- Affiliate News ...
- The RIAA Defeat...
- Affiliate News ...

News Archive

Top 5 Cases
Batmobile Tumbler PC

- Batmobile Tumbler PC
     Score: 81.25
- Camo Cube
     Score: 80.00
- NemoTron
     Score: 80.00
- Wall-E
     Score: 78.33
- R2-D2
     Score: 77.00


Random Rig
Case Name: Thinner ATX


Site Affiliates
Xoxide.com
Newegg.com
Memory Giant
ThinkGeek Electronics1and1 Web Hosting
Modders-Inc
B.C.Modding
Benchmark Reviews
KreativePC
SteelSeries
Pimpin Rigz
Lamptron


Affiliate News


  Forum Index - Web Design - PHP and MySQL Question
Author Initial Thread
sP00N
Modding Wizard

Joined: Jul 5, 2007
Posts: 776
Post Subject: PHP and MySQL Question
Posted on: Sep 10, 2008

How would i make a query that only outputs certain rows on a table that have a specific value in a selected column?

steamid: dead7iest_weap0n
AMD X4 720 @ 3.5GHZ, 4GB DDR2, PowerColor 5770 1GB, 40" LCD, 200gb+ 2TB HDD's
Now A+, Net+, Linux+ and MCTS Windows 7 and Server '08 Certified :D
- Top - Profile - Private Message - Website - Reply

deathstarchris


Joined: Oct 26, 2006
Posts: 323
Post Subject: subject
Posted on: Sep 10, 2008


By value do you mean variable character or numeric?

- Top - Profile - Private Message - Website - Quote - Reply

sP00N
Modding Wizard

Joined: Jul 5, 2007
Posts: 776
Post Subject: subject
Posted on: Sep 10, 2008


a numeric value ie an id # from another sql table that is in a column in the table that i want to show select data.


steamid: dead7iest_weap0n
AMD X4 720 @ 3.5GHZ, 4GB DDR2, PowerColor 5770 1GB, 40" LCD, 200gb+ 2TB HDD's
Now A+, Net+, Linux+ and MCTS Windows 7 and Server '08 Certified :D
- Top - Profile - Private Message - Website - Quote - Reply

deathstarchris


Joined: Oct 26, 2006
Posts: 323
Post Subject: subject
Posted on: Sep 10, 2008


Just to clarify, so do you need the value or the data from the line with the specified value in another column?

- Top - Profile - Private Message - Website - Quote - Reply

sP00N
Modding Wizard

Joined: Jul 5, 2007
Posts: 776
Post Subject:
Posted on: Sep 10, 2008


I just want to show rows that have a specific variable numeric value in a certian column instead of all of the rows.

Here's a graphic example:


edit: epic! muh 666th post :D


steamid: dead7iest_weap0n
AMD X4 720 @ 3.5GHZ, 4GB DDR2, PowerColor 5770 1GB, 40" LCD, 200gb+ 2TB HDD's
Now A+, Net+, Linux+ and MCTS Windows 7 and Server '08 Certified :D
- Top - Profile - Private Message - Website - Quote - Reply

deathstarchris


Joined: Oct 26, 2006
Posts: 323
Post Subject: subject
Posted on: Sep 10, 2008


I apologize, I thought a simple inner join would work, but I'm not sure now. I will see if I can dig something up.

- Top - Profile - Private Message - Website - Quote - Reply

sP00N
Modding Wizard

Joined: Jul 5, 2007
Posts: 776
Post Subject: subject
Posted on: Sep 10, 2008


figured it out, just had to use the mysql_fetch_assoc() function :D and WHERE in my query. lol whenever I do the most simplest code, it always takes me a while to fix up, but this took me 5 minutes to figure out :D


steamid: dead7iest_weap0n
AMD X4 720 @ 3.5GHZ, 4GB DDR2, PowerColor 5770 1GB, 40" LCD, 200gb+ 2TB HDD's
Now A+, Net+, Linux+ and MCTS Windows 7 and Server '08 Certified :D
- Top - Profile - Private Message - Website - Quote - Reply







FusionMods.Net

Total Time: 4.86874