-
Posts
760 -
Joined
-
Last visited
Everything posted by joel24
-
something like SELECT DISTINCT x.u,`group` FROM xernt_mailing x WHERE date <= DATE_ADD("2012-01-27 00:29:31",INTERVAL (SELECT `interval` FROM u_notifications u WHERE u.id = x.u LIMIT 1) HOUR) AND `group` <> "0"
-
what part of it is not working? try run <script src="snow.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ window.onload = function() { alert("working..."); try { snow.count = 30; // number of flakes snow.delay = 20; // timer interval snow.minSpeed = 2; // minimum movement/time slice snow.maxSpeed = 5; // maximum movement/time slice snow.start(); } catch(e) { // no snow } }; //]]> </script> if it isn't working, attach it to your <body onload="function"> event. otherwise - what is snow.js?
-
google. have a look at this or... alternate
-
I would send the confirmation email on the success of the first - i.e. if (@mail('email', 'subject', 'message', 'headers')) { //send confirmation email mail( $_POST['email'], "Thank you", "$ParentsName, Thank you. etc etc ", 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion() ); }
-
Yes mail( $_POST['email'], "Thank you", "$ParentsName, Thank you. etc etc ", 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion() );
-
in the results table, have it set up like results [ home (teamID from teams table) away (teamID from teams table) homeScore, awayScore, season, year ]
-
can you please copy+paste the error?
-
second highest value?! i.e. max-1.. something like this should work $result = mysql_query("SELECT f.*, ( SELECT max(id) FROM links l WHERE (l.username = f.addee OR l.username = f.adder) AND id < (SELECT max(id) FROM links l2 WHERE (l2.username = f.addee OR l2.username = f.adder) ) AS maxValue FROM friends f WHERE f.adder = 'jack' OR f.addee='jack'"); //edit - misread your query if you want to get the max, 2nd, 3rd etc (multiple values) you will have to perform a separate query; SELECT `id` FROM links WHERE adder = 'jack' OR addee='jack' ORDER BY `id` desc
-
couldn't you combine it all into one query? $result = mysql_query("SELECT f.*, (SELECT max(id) FROM links l WHERE l.username = f.addee OR l.username = f.adder) AS maxValue FROM friends f WHERE f.adder = 'jack' OR f.addee='jack'");
-
have a look at some jquery mouseover - or you may want the hoverintent jQuery plugin...
-
have a relational DB with a table for the teams and another table for the results (including year, season etc) i.e. teams [id, name, city, etc, etc] results [team1, team2, winner, score, season, year]
-
only allow downloading files for users who pay
joel24 replied to hassank1's topic in PHP Coding Help
have a database with the file locations, store the files in a folder with permissions restricting public access.. then retrieve the file with PHP (after fetching the location from the mysql database) header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($file)); header("Content-disposition: attachment; filename=".basename($file)); readfile("$file"); -
I recommend trying out the phpMailer class - makes PHP mail a piece of cake!
-
calling info from mysql based on a drag and dropped location
joel24 replied to wright67uk's topic in Javascript Help
have a look at jQuery UI's droppable() function. There is a lot of documentation to help you on your way! -
how to display 3 clickable images in a row from database
joel24 replied to aadil's topic in PHP Coding Help
while ($picP=mysql_fetch_array($pic)) { $base=basename($picP['title']); #... code to iterate between images goes here, # you'll need a counter and when that reaches 3 or modulus 3 == 0, then echo a new table row } -
you have many ifs with no enclosing parenthesis, the same with your while loops. <?php //get cookie do step1,step2,step3 if (isset($_COOKIE["user"])) { //step1 mysql_connect("localhost", "root", ""); mysql_select_db("register_db"); $result = mysql_query("SELECT * FROM register_vote WHERE name = '{$_COOKIE["user"]}'"); //step2 if ($result) { while($row = mysql_fetch_array($result)){ //step3 echo $row['name'] . "|gtop100:" . $row['gtop100'] . "|mcservers:" . $row['mcservers'] . "|xtremetop100:" . $row['xtremetop100']; } //close the while loop } //end if result true //if user has not inserted usernmae just echo false user } else { //else if cookie not set echo "false|gtop100:false|mcservers:false|xtremetop100:false"; //if user submited username set cookie and start at step 1 } ?>
-
what does it display? post your code
-
You need to put in a html anchor tag to link it... while ($row = mysql_fetch_assoc($sql)) { $body .= "<a href='http://abc.php?{$row['appointment_id']}'>http://abc.php?{$row['appointment_id']}</a> \n"; } #edit you should set the content type to HTML if you're having links in there read this //FROM php.net // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-
you have no closing parenthesis on the while loop - while(condition) { } and yes you can use isset $_COOKIE, I would use an if and set $user to contain the user id variable at the start of the code, then continue with your logic using $user if (isset($_COOKIE['user'])) { $user = $_COOKIE['user']; } else if (isset($_POST['user'])) { $user = $_POST['user']; } else { #user not set, error exit("User not set."); } #code in here ## $sql="INSERT INTO register_vote (id, user) VALUES ('','$user')"; [/code]
-
how to display 3 clickable images in a row from database
joel24 replied to aadil's topic in PHP Coding Help
you need another while loop for the second mysql query, at the moment you're only retrieving the first image returned from the query. -
<?php include 'config.php'; //my configuration, username, password etc $sql = "SELECT * from customer c WHERE c.uid = " . $_SESSION['uid'] . "and c.appointmentDate BETWEEN CURRENT_DATE AND (CURRENT_DATE + INTERVAL 7 DAY )"; $sql1= exeSelectQuery($sql); if (isset($_POST['submit'])) { //after clicking on the button if ($sql1) { $to = $_SESSION['mail']; $subject = "Appointment Reminder"; $body = "Dear Customer \n\n" . "Please confirm your following appointment date by clicking on the link . \n"; while ($row = mysql_fetch_assoc($sql)) { $body .= "http://abc.php?{$row['appointment_id']} \n"; } $body .= "Regard\n" . "Admin"; $header = 'From: [email protected]' ; $deliver = mail($to, $subject, $body, $header); if ($deliver) { echo "Appointment Reminder Sent. \n"; } else { echo "Appointment Reminder Sending Fail. \n"; } } } ?>
-
what are the fields in the db table? where are the emails stored...? just to make sure I'm understanding your intentions; you want to extract the appointments from the database and send an email to each user with their appointments?
-
You're not updating or inserting anything for mysql_affected_rows() to return anything