Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 20th, 2002, 04:05 AM
rfigley rfigley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 rfigley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Finding row by the phone number

I'm trying to extract and display some fields from a row in a MySQL database by entering the phone number into a form. Here is the code I'm using but getting "query fail".

<?


include('dbconnect.php');
include('font_setting.htm');

$query = ("select * from tbl_members (phone) VALUES ('$phone')");
//$query = ("select * from tbl_members (phone) VALUES ('$phone')");
//$sql = "INSERT INTO tbl_members (phone) VALUES ('$phone')";

$result = mysql_query($query) or die("Query fail");


if (mysql_num_rows($result) == 0)
{
//echo "result = 0";
} else
{
echo "<CENTER>";
echo "<table border=1>";

while($row = mysql_fetch_array($result))
{
//echo "<table><tr><td>";
//echo "<table border=1>";

echo "<tr><td> " . $row['name'] . "</td><td> " . $row['category'] . "</td><td> " . $row['business_name'] . "</td><td> " . $row['phone'] . "</td></tr>";

echo "</font>";
//echo "</table>";
}

}

echo "</table>";
echo "</font>";

?>


Reply With Quote
  #2  
Old August 20th, 2002, 07:14 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: Finding row by the phone number

php Code:
Original - php Code
  1.  
  2. $query = "select * from tbl_members where phone = '$phone'";

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Finding row by the phone number


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway