|
#1
|
||||
|
||||
|
Help with Dreamweaver/PHP/SQL
I'm playing around with creating a database driven website in Dreamweaver MX 2004 - not something i have done before.
I have search.php with a form and couple menus for the user, and results.php for displaying. It will search MySQL 'bikes' database for MAKE and MODEL. In search.php, the 2 drop-menu objects in form1 are called 'make' (with values Honda, Kawasaki) and 'model' (with values CBR900, ZZR1100). The problem arrives with the recordset on results.php - it works fine if i have sql statement as: Code:
SELECT bikes.make, bikes.model, bikes.style, bikes.engine, bikes.year FROM bikes WHERE bikes.make = 'Honda' AND bikes.model = 'CBR900' Code:
SELECT bikes.make, bikes.model, bikes.style, bikes.engine, bikes.year FROM bikes WHERE bikes.make = 'varMake' AND bikes.model = 'varModel' I tried Name:varMake DefaultValue:% Run-time Value:#Make# ...but its a no-go Anyone got an idea here please?
|
|
#2
|
||||
|
||||
|
I'm only a very small user of PHP/MYSQL but I would suggest from SQL server knowledge that the variables have to be outside the string of other SQL text.
That is: Quote:
John |
|
#3
|
||||
|
||||
|
OK here they have a sample database call:
http://ca3.php.net/mysql So you would want to use: Code:
$query="SELECT 'make', 'model', 'style', 'engine', 'year' FROM bikes WHERE make='$varMake' AND model='$varModel'"; Code:
$query = "SELECT * FROM my_table"; $varModel="Raleigh"; $varMake="High Roller"; Hope that helps. ![]() Corey Milner Creative Director, Indigo Rose Software |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 11:13 PM.








Linear Mode
