Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 27th, 2003, 01:53 PM
Authorized User
Join Date: Sep 2003
Location: London, , United Kingdom.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jams30
Default I'm sure there's a simple answer to this!


Firstly, please excuse my lack of understanding on PHP and MySql as I am but a struggling newbie with all of this!!

I have created a simple MySql database and am trying to retrieve records from it based on a query. I have built a form with two list boxes, 'From' and 'To' - when selecting an option from both lists and submitting the form, the information is getting passed to the next page where I can associate variables $From_Price and $To_Price respectively. As you can see, I have tested these variables in the first echo statement, but when trying to use them as part of a query statement I get nothing appearing on the page as results apart from the "Your selection of properties are..."

include "./common_db2.inc";

echo "<center>Your selection of properties are from $From_Price to $To_Price</center><br><br>";
$link_id = db_connect();
$result = mysql_query("select * from prices WHERE price >= '$From_Price' and price <= '$To_Price' order by price", $link_id);

while($query_data = mysql_fetch_row($result)) {
echo "Property no: ",$query_data[0]," is priced at £",$query_data[1]," and the description on this is ",$query_data[2],"<P>";


Whilst this query works fine with static values I want to the use to be able to choose the parameters that the query is based on.

Can someone please advise me on where I may be going wrong, as the title suggests, I'm sure there's a simple answer to this!!

Many thanks


Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple - Quick Answer hopefully! IainAL VB How-To 4 April 18th, 2007 07:53 AM
Try this, answer me surendran PHP How-To 1 November 14th, 2006 07:09 AM
Please answer canasdaq XML 3 April 19th, 2006 09:04 AM
This has to be a simple question to answer. Bill_Thompson Beginning VB 6 1 March 7th, 2006 01:04 PM
answer IvAnR C++ Programming 1 July 22nd, 2005 08:01 AM

All times are GMT -4. The time now is 02:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.