Jump to content

izbryte

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Everything posted by izbryte

  1. ok, cool. here are a few of my date entries: 2007-11-18 18:14:38 2007-12-07 18:41:31 2007-12-08 08:49:40 "duration" is set to 30 on all of them right now so what I'm looking to get back is the date + 30 days so for example, say they registered on Jan 1, 2008 with 30 days duration (making expiration date Jan 31, 2008). their submission should show till Jan 31, 08 but if they registered on Dec 1, 2007 with 30 days duration (making expiration date Dec 31, 2007). the submission would not show
  2. yes I am using datetime. I'm still stuck though. With the examples you sent me I'm only seeing the posts from today.
  3. I have a script where I'm trying to work out an expiration on their uploaded posts I have a field "date" and a field "duration". When they submit their post date is submitted as NOW() and duration is either "30" or "60" (days). When I pull this back I want to select everythings that NOT expired... so NOW must be less than the DATE they entered it + the DURATION they chose. Here's my query (that's not working) $query = "SELECT * FROM jobs WHERE NOW() < `date` + INTERVAL `duration` DAY AND paid = '1' ORDER BY `job_id` DESC $limit"; Can anyone tell me why this is not working?
  4. In mozilla it comes out just fine with the proper results shown. In IE it just shows a blank screen.
  5. This is a script where user can search jobs by selecting a location or category and entering a search keyword. It works fine in Mozilla but turns up nothing in IE? Can anyone help me? if (isset($_POST['Search'])) { $query = "SELECT * FROM jobs WHERE NOW() < expires AND paid = 'yes' "; $keyword = trim($_POST['keyword']); if($_POST['keyword']!=''){ $find = mysql_real_escape_string(htmlentities($_POST['keyword'])); $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); if(($_POST['category']!='')&&($_POST['location']!='')){ $query .= "AND category = '".mysql_real_escape_string($_POST['category'])."' OR location = '".mysql_real_escape_string($_POST['location'])."' OR title LIKE '%$find%'"; $search = TRUE; } elseif(($_POST['category']!='')&&($_POST['location']=='')){ $query .= "AND category = '".mysql_real_escape_string($_POST['category'])."' OR title LIKE '%$find%'"; $search = TRUE; } elseif(($_POST['category']=='')&&($_POST['location']!='')){ $query .= " AND location = '".mysql_real_escape_string($_POST['location'])."' OR title LIKE '%$find%'"; $search = TRUE; } else { $query .= "AND title LIKE '%$find%'"; $search = TRUE; } } else{ if($_POST['location']!=''){// Check if the location isnt empty if($_POST['category']==''){ // Check if category is empty $query .= "AND location = '".mysql_real_escape_string($_POST['location'])."'"; $search = TRUE; }// End if category is empty }// End if location isnt empty if($_POST['category']!=''){// Check if the category isnt empty if($_POST['location']==''){ // Check if location is empty $query .= "AND category = '".mysql_real_escape_string($_POST['category'])."'"; $search = TRUE; }// End if location is empty }// End if category isnt empty if($_POST['category']!=''){// Check if the category isnt empty if($_POST['location']!=''){ // Check if location is empty $query .= "AND category = '".mysql_real_escape_string($_POST['category'])."' AND location = '".mysql_real_escape_string($_POST['location'])."'"; $search = TRUE; }// End Else }// End if location isnt empty }// End if category isnt empty if($search){ $aa = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($aa)){ echo $row['title']; }// End While }// End if Search is true else { echo 'No search term selected.'; } }// End if form was submitted
  6. I have a script that selects the most recent inputted item for display: $query = "SELECT *FROM jobs DESC LIMIT 1"; Is there an easy way to select the 2nd most recent or 3rd?
  7. Hi! I have a database with a date field (datetime). I'd like to add 60 days to every row in that field. Is there an easy way to do this in phpMyAdmin?
  8. Wow! So many options and I couldn't even think of one! Thanks guys!
  9. I have a form with two dropdown boxes where the user can search my database of jobs by either job category or location or both. Right now I can pull up results if they select an item from each dropdown (both) but I don't know how to pull up the results if they select only one or the other. if (isset($_POST['Search'])) { // Handle the form. // Check for an location. if (!empty($_POST['location'])) { $l = ($_POST['location']); $search = TRUE; } // Check for a category. if (!empty($_POST['category'])) { $c = ($_POST['category']); $search = TRUE; } $query = "SELECT * FROM jobs WHERE (location = '$l') AND ( category = '$c') ORDER BY job_id DESC"; } So now, if they only select a location (for example) then no results will show. How can I fix this?
  10. That worked. It was set relative to the site root. When I changed it to document it dropped the "/". Thanks for your help!
  11. I understand how the relative links work but sometimes as a designer I create a specified folder for my clients. So it's like mySite/theirFolder/theirFile.htm Dreamweaver is adding that "/" in front of everything and when I upload files they aren't showing up right. I have to manually go back into the page and delete every "/" that is in front of a relative link! I've been doing this for years with Dreamweaver Mx 2004 and this has just happened all of a sudden. I must have changed some option not realizing it in Dreamweaver. How can I change it back so there's no "/" in front of the links? ARRRGGG! ... (lol)
  12. I'm sure that this could be set up better... LOL. Basically I have a form that people fill out (name, address, email, etc) and then they have have to check all their specialties using checkboxes. All this info gets put into a database. I'm using the serialize function to handle the checked info. Now I'm creating a form where admin can edit this information if needed. So, I'm trying to basically re-create the form with the previous entered values showing. So the name textbox shows the value entered for name, email textbox shows the email address entered, etc.... and all the checkboxes show up with the previously checked ones checked. Does that help at all?
  13. If I'm in the root folder and I want to link to an image in a folder called images the link should just be to "images/image.gif" right? All of a sudden Dreamweaver is showing it as "/images/image.gif". What's going on?
  14. Yes sorry, I think I'm losing it... LOL it should be choice = unserialize($row['choice']); $choice = unserialize($row['choice']); foreach ($array1 as $value) { echo '<input type="checkbox" name="option[]" value="' . $value . '"'; if ($value == $choice) { echo ' checked'; } echo '>'; }
  15. I am trying to allow editing in an admin section. I have several checkboxes where the user can check one or more of a category which are then sent to a database using the serialize function. I would like the admin to be able to pull up the entire list of checkboxes showing the ones that were previously checked. So here's what I have that doesn't work: the array: $array1 = array ('option1,'option2','option3'); then the rest $choice = unserialize($row['choice']); foreach ($array1 as $value) { echo '<input type="checkbox" name="option[]" value="' . $value . '"'; if ($value == $option) { echo ' checked'; }'; } Do this make sense? As of now the checkboxes show but the previously "checked" ones are not checked.
  16. Thanks for your help! I got it with a little help from the link you sent my new query is: $query = "SELECT * from `info` WHERE `title` REGEXP '^[$id1-$id2]' ORDER BY `firmID` DESC";
  17. I have a page with an alphabetical search. So if they click on "A-C" the variable for $id1 is A and $id2 is C. Then from the database they should get everything that is titled with an A, B or C. Do I use the LIKE statement to do this? Here's what I have now and it's not working: $query = "SELECT * from `info` WHERE `title` LIKE ('$id1%'-'$id2%') ORDER BY `ID` DESC";
  18. Yep! There lied my problem! I had the character length set to small. Oops! Thanks for your help! Thanks for the idea! It seems MUCH easier!
  19. $certifications=unserialize($row['certifications']); echo '<pre>'; print_r($certifications); echo '</pre>'; Is this correct? If so it didn't work... it just came up blank (no results).
  20. I have a form with a bunch of checkboxes and I use the serialize function when I insert them into the database. I'm now trying to use unserialize to display them and it's not working and I'm ready to pull my hair out!!!!! If I enter echo "Certifications:". ($row['certifications']." I get but if I try this... echo <b>Certifications: </b>"; $certifications=unserialize($row['certifications']); foreach($certifications as $fs) { print $fs.' '; } I get this error: Can anyone help me ????
×
×
  • 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.