Jump to content

nelquintin

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by nelquintin

  1. thank you now could you just help me with this line please $result = mysql_query("SELECT name, surname, birthday, mobile, office, home, email, maxprice, minprice, bed, gar FROM client WHERE username = ".$_GET['username']) or die("SELECT Error: ".mysql_error());
  2. i do know the structure of my database.Maybe i can try explain a bit better. When a user logs in i want him to retrive his contacts/client that he has submitted. i have a table called user and then i have tables for each of the user that will use this database. So how can i input the table name in SELECT * FROM `tablename` WHERE `username` = '$username' when i would only know what the tablename is according to who signs in?hope this helps.
  3. i have no problem with the syntax if i know which table to use.the problem is that i dont know how to speficy which table to use unless i know which user has logged in.
  4. ok now i have to write the contacts into the right table.so i tried $result=mysql_query("INSERT INTO users WHERE username = '$username' (name, surname, birthday, mobile, office, home, email, maxprice, minprice, bed, gar) no luck also dont i have to specify the tablename which i would only know once they have signed in?
  5. ok so i have tried # $result = "SELECT * FROM users WHERE username like '".$_GET['$session->username']."'" ; or die("SELECT Error: ".mysql_error()); # any other ideas thanks again
  6. I have developed a membership system with help from this site and many a like and all i would like to know if it better to have a database per user or should i use a table for each user. when the user logs in i just want to display his/her contacts that they have added to the database. i have a vague idea about sessions.
  7. no problem to send the mail when the user recieve the email it just display plain text of the query instead of the result (show the image etc...
  8. how can you send results through email once you queried the database.This just display as plain text when the email recived. <form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> <?php echo "<image src=\"$picture ","\" style=\"border: 1px solid black;\">"; ?> R<?php echo $price = $row["price"]; ?><br>Reference #<?php echo $ref = $row["ref"]; ?><br> <?php echo $description = $row["description"]; ?><br> Bedrooms: <?php echo $bed = $row["bed"]; ?><br> Bathrooms: <?php echo $bath = $row["bath"]; ?><br> Garages: <?php echo $gar = $row["gar"]; ?><br> </textarea> <input type='submit' /> </form>
  9. i have a problem where i can only update the first name in my database details no matter whose logged in.here is the code.Any suggestions? if(isset($_POST['editdetail'])) { $current = trim($_POST['current']); $new = trim($_POST['new']); $confirm = trim($_POST['confirm']); $price = trim($_POST['price']); $area = trim($_POST['area']); $description = trim($_POST['description']); $query = mysql_query("SELECT * FROM Users WHERE username = '$current' LIMIT 1") or die(mysql_error()); $do = mysql_query("UPDATE Users SET price = '$price' LIMIT 1") or die(mysql_error()); $dotwo = mysql_query("UPDATE Users SET area = '$area' LIMIT 1") or die(mysql_error()); $dothree = mysql_query("UPDATE Users SET description = '$description' LIMIT 1") or die(mysql_error());
  10. It still wont display the result in the new page.
  11. thank you for that now i just want to dispaly the results in a new page. i tried this <td width="150"><span class="style1"><a href="moredetails.php?'.$row['picture'].'&row='.$row['ref'].'"" title="More Details">Click here for more details</a><?php echo $ref['ref']; ?></span></td>   </tr> and then on moredetails.php <?php mysql_connect("localhost","user","pass"); mysql_select_db("vap");  ?> $picture = $_GET['picture']; $ref = $_GET['ref']; <? thanks again for your help.
  12. here my code <?php mysql_connect("localhost","user","pass"); mysql_select_db("vap");  ?> <style type="text/css"> <!-- .style1 {color: #000000} --> </style> <table width="300" border="1" bgcolor="#9900FF"> <? $type = $_POST["type"]; $price = $_POST["price"]; $minprice = $_POST["minprice"]; $maxprice = $_POST["maxprice"]; $query = "SELECT * FROM propertys WHERE type LIKE '%".$_POST['type']."%' AND price BETWEEN '".$_POST['minprice']."' AND '".$_POST['maxprice']."'"; $result = mysql_query($query); if (mysql_num_rows($result)) {     while ($row = mysql_fetch_array($result)) {         $picture = $row["picture"];         $price = $row["price"];         $ref = $row["ref"];         $type = $row["type"];         $erf = $row["erf"];         $size = $row["size"];         $bed = $row["bed"];         $bath = $row["bath"];         $gar = $row["gar"]; ?>   <tr>     <td width="150"><span class="style1"><?php echo "<image src=\"$picture ","\" style=\"border: 2px solid black;\"> "; ?></span></td>     <td width="150"><span class="style1"><?php echo $ref['ref']; ?></span></td>   </tr> <?   } } ?> all i need to do now is just add on a "click here for more details" which will open another page with more details.could any one please help my designer left this project half way and im trying to finish it myself.
  13. how do they change the combo box by pushing a button a example is on http://www.leonardleese.com/ when you click on sales the price combo changes and v.v
  14. Thanks but if i push submit it brings up all the clients in the database instead of just the clients matching the propertys price range....
  15. My testing box is nt connexted to any server so it doesnt make a dirrence. If i pull up a property i want to match all my clients in another table with that property the foreign key would be price i think?Should i have a min and max price for my clients?
  16. What i want to do is match my clients(stored in a datbase) to a property ,i pulled up as a result.Here is my code.The thing is it doesnt match the client and the property properly.Here is my code.Your help is appricated. <?php mysql_connect("localhost","root","pass123"); mysql_select_db("vap"); $search = $_POST["search"]; $query = "SELECT * FROM propertys WHERE ref LIKE '%".$_POST['search']."'"; $result = mysql_query($query); if (mysql_num_rows($result)) {     while ($row = mysql_fetch_array($result)) {         $picture = $row["picture"];         $minprice = $row["minprice"];     $maxprice = $row["maxprice"]; $price = $row["price"];         $ref = $row["ref"];         $type = $row["type"];         $erf = $row["erf"];         $size = $row["size"];         $bed = $row["bed"];         $bath = $row["bath"];         $gar = $row["gar"]; echo "<image src=\"$picture ","\" style=\"border: 2px solid black;\"><br><br>"; echo "<br> $ref <br> $price <br> $type <br> $erf <br> $size <br> $bed <br> $bath <br> $gar <br>"; } } ?> <form method="POST" action="matchclient.php"> <input type="Submit" name="Submit" value="Match Client"> </form> And here is matchclient.php <?php mysql_connect("localhost","root","pass123"); mysql_select_db("vap"); $search = $_POST["search"]; $price = $_POST["price"]; $query = "SELECT * FROM client WHERE price LIKE '%".$_POST['search']."'"; $result = mysql_query($query); if (mysql_num_rows($result)) {     while ($row = mysql_fetch_array($result)) {         $name = $row["name"];         $surname = $row["surname"];     $price = $row["price"];     $mobile = $row["mobile"]; $office = $row["office"];         $home = $row["home"];         $email = $row["email"];     echo "<br> Name: $name <br> Surname: $surname <br> Price: $price <br> Mobile: $mobile <br> Office: $office <br> Home: $home <br> Email: $email<br>" ; } } ?>
  17. with mysql and php how would i display diffrent results with image instead of text
  18. Thanks for that maybe i can take a diffrent approach.The site for a estate agency what i want to do is get a property from the site and match all the clients in my database to that property and then email that spefic property to those clients.I have added my code in if it helps.Your help in this is much appricated. This is how i pull up the propertys: <?php mysql_connect("localhost","root","pass123"); mysql_select_db("vap"); $search = $_POST["search"]; $query = "SELECT * FROM propertys WHERE ref LIKE '%".$_POST['search']."'"; $result = mysql_query($query); if (mysql_num_rows($result)) {     while ($row = mysql_fetch_array($result)) {         $picture = $row["picture"];         $minprice = $row["minprice"];     $maxprice = $row["maxprice"]; $price = $row["price"];         $ref = $row["ref"];         $type = $row["type"];         $erf = $row["erf"];         $size = $row["size"];         $bed = $row["bed"];         $bath = $row["bath"];         $gar = $row["gar"]; echo "<image src=\"$picture ","\" style=\"border: 2px solid black;\"><br><br>"; echo "<br> $ref <br> $price <br> $type <br> $erf <br> $size <br> $bed <br> $bath <br> $gar <br>"; } } ?> I pull up the clients in a similar way.
  19. i want to develop a site where i can email certain clients infomation.i already have the search and display option working.when a new product comes on the market i want to email only the clients which came up in the searh query.So say for instance all the clients name and email address are displayed on a page ,how do i gather the email on that page and send the product via php.
×
×
  • 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.