CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 SQL query

Print topic Send  topic

Author Message
bill
Posted: 01/15/2010, 5:57 AM

How do I use info from a custom sql?

$db = new clsDBmydb();
$sql="select username from users where userID=2";
$db->query($sql);
$db->close

Now I need to check if username ie.
If username= "fred"

but getting syntax error

How do I get at the info returned by the query above??

Gena

Posts: 591
Posted: 01/15/2010, 6:30 AM

$db = new clsDBmydb();  
$sql="select username from users where userID=2";  
$db->query($sql);  
if($db->next_record())    
{  
  $username = $db->f("username");  
}  
$db->close  

then use $username as you need.
_________________
Gena
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.