Jump to content

Lukey

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Lukey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I just wanted to say a massive thank you to the people who helped me out on the php board. Thanks to you guys i managed to complete most of my assigment on time. Not a bad feat considering the first time i touched php and mysql was wednesday at 5pm GMT and now early in the morning on friday its pretty much all done and actually working! Cheers
  2. Its ok mate i bodged my way around it by adding a html hidden type input and putting each housename into that as it goes through the loop. Each hidden box with the variable value has a corresponding button and it works!
  3. BUMP Anyone have an idea how i can split the array up into so that i can pass the correct housename variable to the next script?
  4. Aha thanks that was a stupid thing to miss however it has given me a different problem in that the only variable it is passing to the next script is the last record of the results and not the correct one clicked As you can see in the attached screenshot i am aiming to get the button to pass the correct housename across. [attachment deleted by admin]
  5. I have created a database with a table called houses with various house information as fields. My search page is working fine and loads up each result in a separate table using a loop: while($newarray = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $rname = $newarray["hname"]; $rcountry = $newarray["hcountry"]; $rbeds = $newarray["beds"]; $rprice = $newarray["hprice"]; ?> <table cellspacing="0" cellpadding="4" border="1" width="80%" bgColor="#ccff99" borderColor="#ffcccc"> <tr><form action="http://localhost/housedetail.php" method="post"> <!-- Row 1 Column 1 --> <td> <img src="C:\Documents and Settings\Lukey\Desktop\MAIN PROJECT\<?php echo($rname);?>.jpg"> </td> <!-- Row 1 Column 2 --> <td><div align="left"> <?php echo"<li>$rname</li><br/>"; echo"<li>$rcountry</li><br/>"; echo"<li>$rbeds Bedrooms</li><br/>"; echo"<li><i>£ $rprice</i></li><br/>"; session_start(); $_SESSION['housename'] = $rname; ?></div> </td> <!-- Row 1 Column 3 --> <td> <center><h5>Please Click the Button for futher details</h5><br/> <input type="submit" value=" House Details "/></center> </td> </tr> </form> </table> <?php echo"<br/>"; } However i have a button in each result table which links to a php script that loads up a page with further details of the house. I decided to use SESSIONS to pass the housename to the next script so i can retrive the data and display it BUT i can only start one session at a time and because it loops i get errors on my page: Notice: A session had already been started - ignoring session_start() in C:\Program Files\Apache Group\Apache2\htdocs\housesearch.php on line 210 Any help would be most appreciated!
  6. Ok as a temporay fix i added an if statement to all variables taken and if they were blank (ie search all records of that field) i made them "%". Then i changed the SQL statement to all ANDS, it seems to display the correct results however the first record is always ignored which is odd.
  7. I have a database table with various houses in it and fields relating to the price, name, features, country etc. I am creating a html form to search through the records and display the appropriate results using php. The issue is that when it comes to a listbox on the form i have an option for "any country" however i am unsure how to implement this in my sql statement. form code: <select name="country"> <option value="any">Any Country</option> <option value="UK"> United Kingdom </option> <option value="USA">United States of America</option> <option value="Argentina">Argentina</option> <option value="Australia">Australia</option> ... SQL statement: $sql = "SELECT * FROM house WHERE htown = '$town' || harea = '$area' || hcountry = '$country' || beds = '$beds' && pool = '$pool' && garage = '$garage' && aircon = '$aircon' "; The issue is that if country is selected to option "any", "any" cant be found in the records so no results are displayed. This is probably a newbie question a realise but help would be appreciated!
  8. Is that all i need? a left join? i checked through a load of stuff and it seemed that i might need a foreign key or something along those lines. If i use the join command will it keep the tables separate?
  9. Yup im a newbie that doesnt understand the major differences in MS Access relationships and the way its done in mySQL any input would be appreciated The problem: I have a table called "house" with the house's address etc in it: CREATE TABLE `house` ( `id` int(11) NOT NULL auto_increment, `hname` varchar(20) default NULL, `hnum` varchar(5) default NULL, `hstreet` varchar(20) default NULL, `htown` varchar(30) default NULL, `harea` varchar(30) default NULL, `hcounty` varchar(20) default NULL, `hcountry` varchar(25) default NULL, `hprice` varchar(9) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Im attempting to create a separate table that holds extra details about the houses such as number of bedrooms etc. How would i link the two together using the "id" key in the house table? Thanks for the time.
  10. ok so if works if i do this if($_POST["pword"] != $vpassword) { echo($retypepass); } however it does not word if i use $pass strange how it $pass wont accept the password as a string.
  11. Yea that works it displays it! All im trying to do is to compare $pass and $vpassword and continue if they match and throw up an error if they dont. Should be simple I've tried all sorts of didnt types of if statements!
  12. Nope still refuses to display the first one echo($pass); it displays echo($vpassword); fine.
  13. sure thing. <td><div align="left"> <input type="password" name="pword" size="20" maxlength="20" value=""/><br/> <font size=-2><i>Note: Password must be a minimum of 6 characters</i></font> </div> </td> </tr> <tr> <!-- Row 12 Column 1 --> <td><div align="right"> Verify Password: </div> </td> <!-- Row 12 Column 2 --> <td><div align="left"> <input type="password" name="vpword" size="20" maxlength="20" value=""/> </div> </td>
  14. Hi ive created a registration form that has various input text boxes including a "password" and a "verify password" one. My issue is that when it comes to checking the two password boxes are matching. At first i thought it was my syntax etc. but i've narrowed it down to the fact that my code isnt picking up the first password text box at all. Example: //variables for entered data $firstname = $_POST["fname"]; $secondname = $_POST["sname"]; $housenumber = $_POST["hnumber"]; $streetname = $_POST["streetname"]; $townname = $_POST["townname"]; $countyname = $_POST["countyname"]; $country = $_POST["countryname"]; $email = $_POST["emailaddress"]; $phoneno = $_POST["phonenum"]; $username = $_POST["Rusername"]; $pass = $_POST["pword"]; $vpassword = $_POST["vpword"]; ... //testing variable output echo($pass); echo($vpassword); $vpassword displays but $pass does not so im sure its not picking up this information. I have checked that i got the correct names etc numerous times now. Im sure the answer is probably staring me in the face. Any help would be appreciated.
  15. Ok after 9 hours i fixed it. I did a search for libmysql.dll renamed the one in my php folder. Then i copied the original one from the mysql folder to apache/bin and the php folder and it solved the problem. Now i start the real hard stuff.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.