Jump to content

mapleleaf

Members
  • Posts

    250
  • Joined

  • Last visited

    Never

Everything posted by mapleleaf

  1. my mail function sends the from as my server's default from. How do I change this? <?php mail($_POST['email'], 'Registration Confirmation', $body, 'From: register@mysite.com'); ?> Do I need to use some headers or change something in the ini file?
  2. use alias "SELECT subscribers.email as SB_Email" to differentiate.
  3. I have two tables which have a column for email. The emails are not the same. <?php $mailquery = "SELECT subscribers.name, subscribers.email, business_contact.first_name, business_contact.last_name, business_contact.email FROM subscribers, business_contact WHERE subscribers.primary_id = '8' AND business_contact.id = '8'"; $mailresult = mysql_query($mailquery) or die(mysql_error()); $mailrow = mysql_fetch_array($mailresult); ?> I also follow this with a while doing the same. The first time round I only want the businees email and in the while i want all the subscribers email. Business email is always only one. Subscribers could be many. $mailrow['subscribers.email'] doesn't seem to work so how to differentiate? TX
  4. Yes but be sure to put session_start(); before anything else. This kind of password set up is one way. Flash is be able to use php to make the password check.
  5. Hope the Avatars of Love win the game!! What are the odd results?
  6. send the user to another page which checks the session data and header on to your zip download. The answer to your question I do not have but maybe a solution is enough
  7. I am guessing you want an admin to verify something. If so appearance doesn't matter so much. echo '<a href="update.php?id=$row['id']&value=yes">Approve</a>'; Then update.php runs the $query="UPDATE table SET value= '{$_GET['value']}' WHERE id = '{$_GET['id']}'" ; You ought to escape the data for security but that is my concept of how to do it.
  8. Looks to me like your start time is after your end time. It would be easier if you stored time as a timestamp 1235353533 for example. No of secs from 1st jan 1970. Then you could subtract the time and work out how many hours it was.
  9. Actually it works with all the parenths out But thanks anyway $clause = "WHERE $type LIKE '%$posted%' AND (zip = '$zip' OR city = '$city' OR state = '$state' OR country = '$country') ORDER BY zip = '$zip' DESC, city = '$city' DESC, state = '$state' DESC, country = '$country' DESC"; Is giving me what I wanted
  10. Fenway Thanks so much as I'm sure this is close but I am getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC, city = 'jamestown' DESC, state = 'CO' DESC, country = 'USA' DESC )' at line 1 Maybe it needs to be more complicated as in having a sub query for each of the ORDER BYs What do you think?
  11. Is there a MySQL function that can prioritize? For example I want to search for books. The books table contains the city, street,zip and country of the book. If i want the results to show the zip matches, then the city matches, then the state matches and lastly the country matches in that order can it be done with one query? Like zip is 1, city is 2 etc in priority. <?php //so something like: $query = "SELECT * FROM books WHERE title LIKE '%$posted%' AND zip[1] = '$zip' AND city[2] = '$city' AND state[3] = '$state' AND country[4] = '$country' "; ?> This is of course not valid but just to convey the concept. Just had the thought that maybe ORDER by can be used for columns. ORDER BY zip,city,state,country. Help much appreciated
  12. THANK YOU THANK YOU. How many times do I strain my eyes on that one.
  13. So some clarification Are you trying to return all the user_ids that put one of any of the four answers in the answer_id? Or should there be 4 answer columns? If it is the first change your query to OR instead of AND.
  14. If you have phpmyadmin you can export it as a sql. Me thinks your question might need some more details
  15. <?php $query = "UPDATE books SET title = '$book_title', author = '$author', edition = '$edition', subject = '$subject', isbn = '$isbn', condition = '$condition', price = '$price', method = '$method' WHERE id = '$id'"; $result = mysql_query($query) or die(mysql_error()); ?> gives this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition = 'good', price = '6262', method = 'sell' WHERE id = '16'' at line 1 I can't see it. Maybe I should sleep!! ??? Help much appreciated
  16. Redarrow, that is my guess too but I had no idea and Firefox, Safari and Camino aren't fussed about it.
  17. My guess is you have magic qoutes on You can try echo stripslashes($lines[$randline]);
  18. It depends on how you have saved the date in your table. Also what is your date column called? Assuming the date column is saved in this format 1225432548 which is now this may work. "SELECT * FROM $table WHERE col_1='plastic' AND date < NOW() - INTERVAL 7 HOUR ORDER BY submission_id DESC"; Hope this is of use
  19. Assuming that you can put the extra condition: <?php $twentyfour = (time() - 86400); $lastweek = (time() - 604800); $lasttwo = (time() - 1209600); $lastmonth = (time() - 2592000); $lastyear = (time() - 31104000); $result = mysql_query("SELECT * FROM $table WHERE col_1='plastic' AND date < $lastmonth ORDER BY submission_id DESC"); ?> Or something along those lines
  20. This odd as it only happens on IE and AOL. I have a page that processes a form which then does a header("Location: file.php") Now the new file.php is an absolute path to a shared secure server. The server is different from the referring url. Eg example.com to https://73here.fhsjh.com/~user67/file.php Any ideas why the new file will show up for about a second and then go to an error page. Only in those wonderful browsers of course(in two years we can ignore them )
  21. <?php session_start(); unset($_SESSION['u']); session_destroy(); ?> having $_SESSION['u'] = 'name';
  22. i tried that but if there is a cookie it doesn't end it
  23. I am trying to end a session for logging out. If i set $_SESSION['user'] and by default sessions are creating cookies how do i delete the cookie? I don't know the cookie name. unset($_SESSION['user']) is not enough. Thanks
×
×
  • 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.