PHP - Masters Of Php Help Me Please !!
i have just joined this for and i am desperate for help,
I am sure what i want is pretty easy, but you judge. What i want is a code to add certain amount of numbers ( points ) when a user visits it. i already have a mysql database with fields like , username , Id , Password and Points, how can i create a simple code to just add lets say +10 points when he register to my Feed ? and i will really be grateful if you give me a code so that they do that once every 24 only. ( i know it's done using timestamps but how ) I already posted this on several forums but some dudes wanted money for this and i don't really think it is worth 100$ for less than 10 lines code. Best Regards ! Thanks In advance, Issa K Similar TutorialsOkay... so I am loading some content into my page from the database... I know how to do this normally... but here is the sticking point... I want to load the content from one of 5 options (so there are multiple pages with 5 different options for body copy) depending on what the value of the cookie is... Here is what I tried, but it did not work: //Determin which page ID to use in our query ---------------------------------------------------------------------------------------------- if (!$_GET['pid']){ $pageid = '1'; } else { $pageid = $_GET['pid']; } //Query the Main Content and Titles for the proper page --------------------------------------------------------------------------------------------- $sqlCommand="SELECT process_mainContent_vers1, process_mainContent_vers2, process_mainContent_vers3, process_mainContent_vers4, process_mainContent_vers5, process_pagetitle FROM pages_process WHERE process_id='$pageid' LIMIT 1"; $query=mysqli_query($myConnection, $sqlCommand) or die (mysql_error()); $body = ''; $title = ''; while ($row = mysqli_fetch_array($query)) { if (isset($_COOKIE['career_status'])) { $carreerStatus = ($_COOKIE['career_status']); if ($carreerStatus=="Starting Residency/Graduating Medical School") $body = $row["process_mainContent_vers1"]; if ($carreerStatus=="Ending Residency/Starting Fellowship") $body = $row["process_mainContent_vers2"]; if ($carreerStatus=="Practicing Physician") $body = $row["process_mainContent_vers3"]; if ($carreerStatus=="Practicing Physician") $body = $row["process_mainContent_vers4"]; if ($carreerStatus=="Hospital/Practice Administrator") $body = $row["process_mainContent_vers5"]; } else { $carreerStatus = ($_SESSION['career_status']); if ($carreerStatus=="Starting Residency/Graduating Medical School") $body = $row["process_mainContent_vers1"]; if ($carreerStatus=="Ending Residency/Starting Fellowship") $body = $row["process_mainContent_vers2"]; if ($carreerStatus=="Practicing Physician") $body = $row["process_mainContent_vers3"]; if ($carreerStatus=="Practicing Physician") $body = $row["process_mainContent_vers4"]; if ($carreerStatus=="Hospital/Practice Administrator") $body = $row["process_mainContent_vers5"]; } $title = $row["process_pagetitle"]; } mysqli_free_result($query); //----------------------------------------------------------------------------------------------------------------------------------------- LOL note the topic is a pun at Help Vampires... I actually have an unchallenging question. I'm trying to echo out a column in a MySQL table. I'm getting one field echoing, but not the others: I'm using this code style, but I've made a small mistake somewhere at the end, I've tried many combinations trying to fix it, but haven't succeeded.. $query = "select email from newsletters"; $result = mysql_query($query); $row = mysql_fetch_array($result); foreach ($row as $email) {echo $email;} I got the argument foreach() straight out of the manual and copied the syntax style exactly as was demonstrated in the example, but its still not working. What have I done wrong? |