Jump to content

therelelogo

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

therelelogo's Achievements

Member

Member (2/5)

0

Reputation

  1. hmm i'm not sure it would to be honest, may be easier to ask then is there a wilcard that would return all values whether the row was blank or had something in it? like * = searches for all? or ALL or something like that? or is that just wishful thinking?
  2. i imagine a good way to do this (as i thought about doing one for my restaraunt where i work) would be... create a page with the layout of your restaraunt, for example, put little "tables and chairs" as they appear in real life, onto the page. when a logged-in user clicks one it would "reserve" it in a database for a specific night. i think that would be the best way, you just need to call the tables like table1, table2 etc so your script knows whuich to reserve. you could also show underneath the pictures of the tables [Reserved] or [available] as needed if it was help in actually setting up the log-in feature, theres some decent tutorials on how to do this (my knowledge is limited) hope this helps
  3. any suggestions how to change it? or could point me in the right direction?
  4. hi, i'm wondering, is it possible to search by multiple fields at the same time let me re-phrase that, i know it is possible BUT (and i dont know the correct terminology here) can i search by something in the URL too? here is my code: $result = mysql_query("SELECT * FROM adverts WHERE (ad_type = 'standard') AND (category = '$_GET[cat]') AND (i_condition = '$_GET[cond]') ORDER BY item_id DESC") or die(mysql_error()); this page returns all that meet the critera of "category" and "i_condition" BUT if one is returned as null, i.e '' then any from the table that arent null are not returned. i hope i have explained this easy to understand. basically what i want to know is, if a value in the url is null (meaning nothing for that field should be searched for) how can i have it return all the results for the other url search fields? oh god i hope this makes sense. another example: /category_pages/full_cat.php?cat=entertainment /category_pages/full_cat.php?cat=entertainment&cond=new in the first link "cond" is not being searched for so i would want all fields returned that just have the matching "cat" in the second i would want to filter by both, so my question is, in the first example how can i set the code (php above) to just ignore it for the time being unless the "cond" part is in the url? any help appreciated thanks
  5. amazing. thank you very much
  6. Hi, I usually hate when people ask someone to basically write thier codes for them, but this kinda feels like one of those times. Basically i only want 5 returns from my code below, rather than every return that matches my criteria. <?php // Make a MySQL Connection mysql_connect("", "", "") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); // Get all the data from the "example" table $result = mysql_query("SELECT * FROM emails WHERE e_to = '{$_SESSION['SESS_LOGON_NAME']}' and e_read = 'NO' ORDER BY ID DESC") or die(mysql_error()); echo "<table border='0'>"; echo "<tr> <th></th> <th></th> <th></th> <th></th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo "[".$row['e_from']; echo "]"; echo ", re: "; echo $row['e_subject']; echo "</td></tr>"; } echo "</table>"; ?> if at all possible could someone help modify my code to do what i want? i would be very grateful. Thanks in advance
  7. Hi, Okay, i have no idea what's gone wrong here - yesterday my codes were working fine, and today they arent. I have not changed a single letter of the coding on these pages but my site just isnt accepting my passwords. When i went to create a new user i noticed this at the top of the page: but i dont really know what it is telling me is wrong? i've tried changing the file permissions etc but like i say, nothing has changed even a little bit. maybe its my computer or something?? the site is www.cumbrianadverts.com if anybody wants to try making an account to see what im talking about. any help is appreciated Thanks
  8. yup, exactly like that thank you very much
  9. Hi, very simple i'm sure... i have a code for a text box to pull info into from a mysql table. easy enough: <?php echo "<input type=\"text\" id=\"b_info\" name=\"b_info\" value=\"$b_info\" style=\"width: 327px\" /text>"; ?> but suppose i dont just want a "line of text" i want one of those boxes with the scroll bar down the side (lol like the one im writing this in ) how do i change the above code to do it? i though doing this: <?php echo "<input type=\"textarea\" id=\"b_info\" name=\"b_info\" value=\"$b_info\" style=\"width: 327px\" style=\"height: 185px\" /textarea>"; ?> would work, but obviously not, all ive done is make the box bigger easy workaround? Thanks
  10. also...something else i noticed. some of the columns in the error were '' << meaning nothing, blank, nothing entered....does the form work if they all have something entered? maybe your form isn't processing blank fields correctly - hence, sometimes it would work other times it wouldnt
  11. hi, i have the update command further down in my code, and i know that works because if i change " has been uploaded";} else{ $image_location1 = "$b_OI1"; $image_location1_short = "../uploads/business_pics/CAno_image.jpg"; for " has been uploaded";} else{ $image_location1 = $b_OI1; $image_location1_short = "../uploads/business_pics/CAno_image.jpg"; ...the value entered into the mysql is $b_OI1 which is not correct. likewise if the user uploads an image the new path is stored, but if no new image is upladed the path stored becomes "" (or nothing, a space, nothing entered - how ever you want to say it). not sure how the php code would be removed? but thats no what was meant by the first post Thanks
  12. whatever this refers to, should the error not be: VALUES ('', 'Blacksmith', 'because', '') at line 2? note the added ' and ) - just a suggestions, but have you not finished writing this line in whatever file it refers to?
  13. Hi, This is what im having difficulty with - One page allows my user to upload images, the path is saved into a mysql database - this works fine. Now my new page will allow the user to change the file - effectively changing the path in the database. heres the code i have so far: <?php // Make a MySQL Connection mysql_connect("host", "database name", "password") or die(mysql_error()); mysql_select_db("a9203152_adverts") or die(mysql_error()); // Get all the data from the "example" table $result = mysql_query("SELECT * FROM adverts_business WHERE created_by = '{$_SESSION['SESS_LOGON_NAME']}'") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table $b_OI1 = $row['image_1']; $b_OI2 = $row['image_2']; $b_OI3 = $row['image_3']; $b_OI4 = $row['image_4']; } //image first // Where the file is going to be placed $target_path = "/home/a9203152/public_html/uploads/business_pics/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile1']['name']); $image_location1 = "../../uploads/business_pics/". basename( $_FILES['uploadedfile1']['name']); $image_location1_short = "../uploads/business_pics/". basename( $_FILES['uploadedfile1']['name']); if(move_uploaded_file($_FILES['uploadedfile1']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile1']['name']). " has been uploaded"; } else{ $image_location1 = "$b_OI1"; $image_location1_short = "../uploads/business_pics/CAno_image.jpg"; echo "There was an error uploading the file, please try again!"; } ?> okay, so $b_OI1 is the Original Image path for file 1 that is pulled from the database at the start of the code, now as with all my other pages, if there is no file to "move" then the code automatically goes to the "else" statement so in this case $image_location1 should = $b_OI1 meaning the new "image location1" equals the original path when nothing has been uploaded yes? but the code removes the path from the database rather than keeping it the same? i hope that makes sence, any help is appreciated Thanks
  14. hi, thanks for the reply few minor adjustments but that solved my problem thank you very much
  15. *BUMP* any suggestions appreciated, just need it to start a new line after 5 results?
×
×
  • 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.