Jump to content

adam.jones2

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

1 Neutral

About adam.jones2

  • Rank
    Newbie
  • Birthday 11/19/1941

Profile Information

  • Location
    UK
  1. get error Parse error: syntax error, unexpected '}' in C:\wamp\www\SEARCH FORM\quicksearch.php on line 31
  2. a service i will provideso i wanna make a public api key for my web services and want a read only web service i was reading about Soap and rest and Creating the WSDL file but couldnt get my head around it
  3. I want to create a api key off my own from what iv read i need to create my data into xml format how are api keys genrated
  4. ok thanks for the info
  5. Here is the wamp index page index.php
  6. Iv gone with this approch. any ideas why it dont work? $Make = $_POST['make'];$Min_Price = $_POST['pf'];$Max_Price = $_POST['pt'];//check if there was tried a searchif ($_POST["make"] ||$_POST["pf"] || $_POST["pt"]) {//ok, this was a search$query = " car_make= " . $_POST["make"] . "";if ($Min_Price || $Max_Price)$query= " (car_price >= " . (int) $_POST["pf"] . "" . ($_POST["pt"] ? " AND car_price <= " . (int) $_POST["pt"] . "" : "") . ") ";// Search Array if (is_array($query)) { $cars = mysql_query("SELECT * FROM site_cars WHERE" . implode(" AND " , $query) . " ORDER BY car_price desc"); } else die('<p class="error">######.</p>'); $numresults=mysql_query ($query); if(!$numresults) { echo mysql_error(); exit;}
  7. I cant see any echos on the page <dl class="content"><dt>{$langues[$langue]['versa']}</dt><dd>${apacheVersion} </dd><dt>{$langues[$langue]['versp']}</dt><dd>${phpVersion} </dd></br> <dd><ul>
  8. adam.jones2

    Output PHP in {}

    on the wamp index page its outputs date in {} example {$langues[$langue]['titreConf']} how is this done? id rather used this than echos
  9. updated and get this error Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\\quicksearch.php on line 3
  10. im using a search form where if nothing is selected the value is "" is there a way around this?
  11. adam.jones2

    API KEY

    how do you create a API key for web services
  12. I have a PHP/SQL Query $query = "SELECT * FROM site_cars WHERE car_Make = $Make AND car_price BETWEEN $Min_Price AND $Max_Price"; If the $Min_Price AND $Max_Price is equal to "" the query fails to run. is there a way around this?
  13. Can anyone help we as to why this is not working, When you form is submited with value of "" i want it to search everything <?phpinclude ("db.php"); //Connect to the database using values from db.php ajones_cardealer $database variable value from db.php$connect = mysql_connect($host,$username,$password) or die('<p class="error">Unable to connect to the database server at this tim</p>'); //select the database we are going to use in this case itsmysql_select_db($database,$connect) or die('<p class="error">Unable to connect to the database at this time.</p>'); // Get the posted value based on option select. $Make = $_POST['make'];$Min_Price = $_POST['pf'];$Max_Price = $_POST['pt']; // Create SQL query to find the row with make_id.$query = "SELECT * FROM site_cars WHERE car_Make = $Make AND car_price BETWEEN $Min_Price AND $Max_Price";// Execute the query to get number of rows that contain search kewords$numresults=mysql_query ($query);$row_num_links_main =mysql_num_rows ($numresults);//output results//If Query doesn't return any results search * if($row_num_links_main < 1){ $query_all = "SELECT * FROM site_car"; $numresults=mysql_query ($query_all); $row_num_links_main1 = mysql_num_rows ($numresults);}?>
  14. This what i have but does not workThis Just searches everythingplease help <?php$Make = $_POST['make']; // would equal Car name or ""$Min_Price = $_POST['pf'];$Max_Price = $_POST['pt'];$query = "SELECT * FROM site_cars";$result=mysql_query ($query);$filter = array();if (!empty($Make)) {$filter[] = "car_Make = $Make";}if (!empty($Min_Price)) {$filter[] = "car_price = $Min_Price";}if (!empty($Max_Price)) {$filter[] = "car_price = $Max_Price";}if (!empty($filters)) {$query .= ' WHERE ' . implode(' AND ', $filters);}?>
  15. Thanks i have taken you advice and updated the phpstill no feature where it searches the whole database if all value = "" also no feature where if i select Min price only it will search everything above that price range updates php attached quicksearch.php
×
×
  • Create New...