Jump to content

wernervantonder

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wernervantonder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry please explian to me what you mean. Thanks Werner
  2. I would like to create something similar to facebook idea. I would like the user to submit a photo and it must display upon next page refresh. i got an idea how to do text but the picture i dont. do the post it to a public folder on the webserver of do i store it in mysql dbase? how would i do this? Thank you very much Werner
  3. Hi i am new to PHP. I would like people to enter a message on my website and then a text scroller must display all the messages that was stored in the database. How would i do that? Regards Werner
  4. Hi i am new to PHP. I would like people to enter a message on my website and then a text scroller must display all the messages that was stored in the database. How would i do that? Regards Werner
  5. no not yet. i have to test it but can only test in few hours time. so by tomorrow i shall let you know if i have success or not. Thank you for your assistance.
  6. Sorry that i ask so many dumb questions. does this look better? delete from operator where ((date('Y.m.d') - 'Date_Created')< 7 ) ; cause this is what i used before and it only deleted if the sign was > instead of < altough there was dates in the records wich was smaller.(look below) "DELETE FROM operator WHERE date('Y.m.d')- 'Date_created' < 7 AND Level='0'"; how do i get it to also only delete records with level 0?
  7. Thank you. I dont use timestamp though to save the date. insted i use this : $curdate = date('Y.m.d'); so when i save into the database it saves the date in format = date('Y.m.d'); i tried to say : delete from operator where ((date('Y.m.d') - 7) < 7 ) and level ='0' but its not working. Where does my whole problem lie? am i saving it wrong to to the database? date('Y.m.d') is a timestamp of today though. Thank you
  8. Good day to all that help me i would like to thank you for your assistance so far. how ever the advice did not exactley help me yet. this is what i tried and it failed: mysql_select_db($database_operator, $operator); $query_delete = "DELETE FROM operator WHERE ((TO_DAYS(CURDATE() - TO_DAYS(Date_created)) > 7) AND Level='0'"; $delete = mysql_query($query_adminlogin) or die(mysql_error()); ?> the above code generates an error when i execute it stating that im using wrong version of MySQL. i am using for test purposes (as i know it works on my host) EasyPHP 1.8. Then i tried the following : $curdate = date("Y.m.d"); mysql_select_db($database_operator, $operator); $query_cleaunup = "DELETE FROM operator WHERE '$curdate' - 'Date_created' < 7 AND Level='0'"; $cleaunup = mysql_query($query_cleaunup) or die(mysql_error()); When i execute this code it does nothing. but note that when i change the < sigh to > then it deletes all the Level 0 entries! I just basically want to delete all the entries that is older than 7 days and is lovel 0 in my database. How do i do it? please i am desperate for an answer. I appreciate your response!
  9. Thank you for the quick response! you guys are magnificent. How do i insert a datestamp via php? i am more familiar with Delphi and there i use date(now) function. Please can you supply or point me in the right direction with php code. Thank you verry much Werner
  10. I would like to delete all the records in mysql database that is older than 7 days. How do i go about selecting it in the database ( currentdate - 7). my database is ctrack1 table is operator fields is: ID,Username,Password,Date_created,Level Please assist Greatley appreciated!
  11. Thank you everyone i shall try what you reccomended! i am still a beginner at php so i might just ask some more. if that is ok? Werner
  12. Thank you for your help it helped. how ever i have a new question please assist me if you can! The subject is called : mysql_numrows(): I realy appreciate your help! Werner
  13. Good day to everyone! I am desperate for help: i just want to say thank you very much for helping me! I have craeted a database wich contains info on businesses contact details.  i have a page called index.html and its form contains two list boxes and a submit button. when i press submit it follows the "action" of opening results.php. basicly i want it to search the database and filter from 2 index fields the data that was selected in the list boxes on the index.html page. how ever i get this error: [b]Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\results.php on line 19[/b] basicly i use a loop to display my data in tables. Here is my code for that php page: <? include("topresults.html"); ?> <? include("connect.php"); mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); //collect data sent from form $area = $_POST['area']; $category = $_POST['services']; $querysuburb = " SELECT*FROM $table WHERE area=$area AND category=$category"; //this is where my error lies $result=mysql_query($querysuburb);  $num=mysql_numrows($result); mysql_close(); echo "<b><center>Your Search Results matching Area: $area and Category: $category</center></b><br><br>"; $i=0; while ($i < $num) { $ID=mysql_result($result,$i,"ID"); $company=mysql_result($result,$i,"company"); $name=mysql_result($result,$i,"name"); $tel=mysql_result($result,$i,"tel"); $cel=mysql_result($result,$i,"cel"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $address=mysql_result($result,$i,"address"); $area=mysql_result($result,$i,"area"); $suburb=mysql_result($result,$i,"suburb"); $category=mysql_result($result,$i,"category"); $logo=mysql_result($result,$i,"logo"); $weblink=mysql_result($result,$i,"weblink"); #start building an HTML table that uses $table $list = "<table width=\"350\" border=\"1\" cellpadding=\"2\" cellspacing=\"7\" bordercolor=\"#000000\" class=\"right_articles\">"; $list .= "<tr><th>Company Name </th> "; $list .= "<td>".$company."</td>"; $list .= "<tr><th>Name</th>"; $list .= "<td>".$name."</td>"; $list .= "<tr><th>Telephone Number</th>"; $list .= "<td>".$tel."</td>"; $list .= "<tr><th>Cellular</th>"; $list .= "<td>".$cel."</td>"; $list .= "<tr><th>FAX</th>"; $list .= "<td>".$fax."</td>"; $list .= "<tr><th>E-Mail</th>"; $list .= "<td>".$email."</td>"; $list .= "<tr><th>Address</th>"; $list .= "<td>".$address."</td>"; $list .= "<tr><th>Metropolitan Area</th>"; $list .= "<td>".$area."</td>"; $list .= "<tr><th>Suburb</th>"; $list .= "<td>".$suburb."</td>"; $list .= "<tr><th>Category</th>"; $list .= "<td>".$category."</td>"; $list .= "<tr><th>Website Address</th>"; $list .= "<td>".$weblink."</td>"; $list .="</table><br>"; echo( $list); $i++; } ?> <? include("bottom.html") ?> Thank you so much in advance for your help it is greatley appreciated! Regards Werner
  14. Thanx guys it is greatley appreciated, You got the right idea i basicaly want to take the selections made in listboxes and click submit button and execute php where i assign those values to variables :$area and $category with sql that says select*from databse WHERE $area = listbox1 and $category = listbox2. so my question is wht wording do i use to assign those listboxes selected content to variable? thanks werner
×
×
  • 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.