redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Wednesday 18 September 2019 18:22

Ask your IT question here

simple SELECT FROM query



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Database discussion forum
View previous topic :: View next topic  
Author Message
gilbertsavier
New Programmer


Joined: 02 Jul 2009
Posts: 21
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
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> Database discussion forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo