Time2Dine.co.nz is Online Restaurant Booking
 
Elusion Electronic Cigarette
 New Zealand Restaurants Forum
Restaurant Forum | Contact Time2Dine | Book Online & Save | About Time2Dine

Go Back   New Zealand Restaurants & Food Forum > Search Engine Optimisation > Mysql howtos
Register

Reply
 
LinkBack Thread Tools
  #1  
Old 6th Aug 09, 04:31 PM
Junior Reviewer
 
Join Date: Jun 2009
Posts: 5
gilbertsavier is on a distinguished road
Default simple SELECT FROM query

Hi,
Could someone help with a simple MySQL request. I seem to be having trouble selecting from more than one field in the same table.

TABLE: User Data
|-----------------------|
username | password
|-----------------------|

Code:

$result = mysql_query ("SELECT `username` FROM `User Data`")
or die(mysql_error());

$row = mysql_fetch_row($result); // converts the result into an array

mysql_close($link);

echo $row[0] ;

This snip of code works fine to return one value but I want to select the 'username' and 'password' columns FROM 'user data' WHERE 'username' = '$username' AND 'password' = '$password'

... in one query.

the $username $password variables are delivered via query string.
__________________
Thanks & regards,
Lokananth
Live Chat Software By miOOt
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Optimization gilbertsavier Mysql howtos 0 17th Jul 09 07:16 PM
Javascript Validation On Multiple Select Lists gilbertsavier HTML & Javascript Howtos 0 17th Jul 09 07:11 PM
SQL query program to edit records Big Mountain Mysql howtos 0 11th Feb 08 09:37 AM
Mantra Simple Indian Dining T2DMan Henderson Restaurants 0 13th Apr 07 06:53 PM
Query About T2DMan's Google Adsense Tip... TheTranceArena SEO vBulletin 7 1st Dec 06 12:32 PM



Powered by: vBulletin Copyright ©2000 -2012, Jelsoft Enterprises Limited.
Search Engine Friendly URLs by vBSEO 3.2.0
© 2010 Time2Dine