Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Okay, give me an example of what data would look like in "start_end_date".
  2. Okay...I think you need to explain exactly what your doing. Also, post your database structure. I thought you had a table with a date in it (not a start AND end date for each row) and you wanted to be able to search through that table for any records with a date in between two given dates.
  3. Here is an example of how you can do it <?php if (isset($_POST['submit'])){ $message = ""; //check for empty values if (!isset($_POST['f1']) || empty($_POST['f1'])) $message .= "<br>f1"; if (!isset($_POST['f2']) || empty($_POST['f2'])) $message .= "<br>f2"; if (!isset($_POST['f3']) || empty($_POST['f3'])) $message .= "<br>f3"; if ($message != ""){ echo "The following fields are blank. Please enter the required information:"; echo $message; } else { echo "Everything was filled in"; } } ?> <p> <form method="post"> <input type="text" name="f1"><br> <input type="text" name="f2"><br> <input type="text" name="f3"><br> <input type="submit" name="submit"> </form>
  4. To be honest, it's nearly impossible (for me at least) to help people with pagination problems. I remember first doing pagination and it took me a while to find a tutorial that worked out right. So I just kept trying different ones, and finally I got one. I suggest searching Google again and keep on trying different tutorials out. This one looks good http://php.about.com/od/phpwithmysql/ss/php_pagination.htm
  5. Why are you using mysql_result when you want to loop through all the rows? Do this <?php $result=mysql_query($query)or die(mysql_error()); $num=mysql_numrows($result); while ($row = mysql_fetch_assoc($result)){ echo $row['event'].'<br>'; } ?> I also put a die statement at the end of your query.
  6. Show us the code where you tell it to return something.
  7. Do a query like this SELECT img FROM table WHERE shown < show ORDER BY rand() That will ONLY select banners that can still be shown. Then after you show the banner, you can do an update query to update the 'shown' field by one.
  8. I Googled "PHP forums tutorial"
  9. Well...does the variable $aid have a value? ...and is it the correct value?
  10. Look $_SESSION["aid"] =TRUE; $_SESSION["apass"] =TRUE; Your not actually giving the sessions the value of the password and whatever "aid" is. How do you expect it to find any results in the DB to match? When they log in you need to give those sessions the correct values.
  11. Store the information either in a database or text file. That way you can keep track of how many times it has been displayed.
  12. Why are you registering a session if you don't know what you want it to hold? I guess just set it to TRUE. $_SESSION['variable'] = TRUE;
  13. PHP is case-sensitive. Change it to $_SESSION['variable'] = "value"; Don't forget to call session_start either.
  14. This will display all odd numbers between 2 and 99 <?php for ($i=3; $i<100; $i+=2){ echo $i.'<br>'; } ?> I'm not sure how you want the table, so if you need help with that, explain it a little.
  15. There are tons of results on google http://www.phpeasystep.com/workshopview.php?id=12
  16. I'm not positive, but I think your date format has to be yyyy-mm-dd. I'm going to have to come back to this thread later on today, I have to go to work.
  17. It's printing out where 'advanced' between 'advanced' Advanced? I thought the variables held dates? Now I'm confused on what your even trying to do...explain what your trying to select from the database.
  18. Okay, try changing these lines <?php $query = "(select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from arcamax where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from google where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from drudge where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from human_events where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from newsmax where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from street where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from townhall where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from weatherbug where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from worldnet where '$search1' between '$search2') order by mailedlist"; $numresults=mysql_query($query); ?> To <?php $query = "(select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from arcamax where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from google where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from drudge where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from human_events where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from newsmax where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from street where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from townhall where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from weatherbug where '$search1' between '$search2') union (select id,promo_code,start_end_date,mailedlist,description,orders,totalrevenue from worldnet where '$search1' between '$search2') order by mailedlist"; $numresults=mysql_query($query)or die(mysql_error()." With query $query"); echo "<p>$query<p>"; ?> Show us what it gives you. ?>
  19. Do this <?php $query = "SELECT * FROM topics WHERE topics.systems LIKE '%$system%' OR topics.topicid = '$topic' ORDER BY dateline ASC" $result = mysql_query($query)or die(mysql_error()."With Query:<br>$query"); ?>
  20. You can try pfsockopen() http://us3.php.net/manual/en/function.pfsockopen.php
  21. Not a PHP question...but you can do it with JavaScript. <script language="javascript"> function link(url){ window.location = url } </script> <table border=1 onclick="link('http://www.google.com')"> <tr> <td>Blah blah blah</td> </tr> <tr> <td>Blah blah blah</td> </tr> <tr> <td>Blah blah blah</td> </tr> </table>
  22. No, like this SELECT * FROM table WHERE '$search_variable1' BETWEEN '$search_variable2'
×
×
  • 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.