Jump to content

puritystandsout

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

puritystandsout's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there, Could someone please help? I am using php-mysql as my backend. I want to sell a subscription on the site I am writing using paypal. My idea is to write a date one year in the future into my members database into a subscription_expiry colum once the payment for subscription is successful. How would I go about this? At the end of the transaction, I will need the member_id of the person who was logged in and purchased the subscription, to be able to query the db and update the correct record within my members table. Any advice anyone? Thank you very much. By the way, yes I am using session variables in the login of my site, in case you needed this info. THE INFO & DOCS PAYPAL HAVE DON'T REALLY HELP ME. Regards and Jesus Christ's blessings, Chris Cundill
  2. I'm getting somewhere I think... What Barand said made sense its just his sql statement is not quite what I need. Would someone be able to elaborate on this to help me understand how to actually return the distance between two points. Many Thanks. Regards and Jesus Christ's blessings, Chris Cundill
  3. Fixed it sorry to bother you. For the benefit of the community it was blank lines after my closing ?> and the beginning of my html! Thats all!
  4. Please could you help?  Here is my script: [code] <?php // start the session session_start(); $errorMessage = ''; if ( (isset($_POST['username'])) && (isset($_POST['password'])) ) {   include '../db/config.php';   include '../db/opendb.php';   $username = $_POST['username'];   $password = $_POST['password'];   $password_hashed = md5($password);     // check if the user id and password combination exist in database   $sql = "SELECT *   FROM accounts   WHERE username = '$username'   AND password = '$password_hashed' ";   $result = mysql_query($sql) or die('Query failed. ' . mysql_error());   if (mysql_num_rows($result) == 1) {   // the user id and password match,   // set the session   while ($member_details_array = mysql_fetch_assoc($result)) { $member_id = $member_details_array['member_id']; $_SESSION[$member_id] = true; }     // after login we move to the main page   header("Location: main.php");   exit;   } else {   $errorMessage = 'Sorry, wrong username and password combination';   }   include '../db/closedb.php'; } ?> [/code] ---------------------------------------------- It seems to do all the db stuff ok, logs the user in but I get this error: Cannot modify header information - headers already sent by ... Many Thanks in advance for your help. Regards and Jesus Christ's blessings, Chris Cundill
  5. Besides having to pay a big subscription fee to the post office in the uk to search on post codes... I want to be able search on UK Cities and certain proximities like 50 mile radius... Does anyone have any idea how I'd go about this?  Has anyone done this before? Please help.  Thanks... Regards and Jesus Christ's blessings, Chris Cundill
  6. Dear anyone who can help. I am trying to execute a complex query: [code] $query1 = mysql_query("SELECT * FROM members WHERE (skill1 LIKE '%$select_search%' OR skill2 LIKE '%$select_search%' OR skill3 LIKE '%$select_search%) AND skill_sought1 LIKE '%web developer%'  ") or die (mysql_error()); [/code] I get this error: [quote] 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 '%web developer%'' at line 1 [/quote] Any ideas?  I need to use multiple OR and one AND boolean(s)... Many Thanks. Regards and Jesus Christ's blessings, Chris Cundill
  7. Hey, you're right! It worked!  Thank you one and all - you've really helped me get past a frustrating moment.
  8. Could anybody help?  ??? [move]please[/move]
  9. I think you are all assuming that I retrieving just one record/row from the database.  I am not.  There are multiple rows and there could be duplicate entries in any of the three columns I am searching on. I need to get all data from these three columns for all the records/rows, put them into an array and filter out duplicates. Thanks for your continued help.
  10. Okay point taken. Here is the code I've been trying... [code] $query = mysql_query("SELECT DISTINCT skill1 FROM members ") or die (mysql_error()); $skill1_array = mysql_fetch_assoc($query); $query = mysql_query("SELECT DISTINCT skill2 FROM members ") or die (mysql_error()); $skill2_array = mysql_fetch_assoc($query); $query = mysql_query("SELECT DISTINCT skill3 FROM members ") or die (mysql_error()); $skill3_array = mysql_fetch_assoc($query); $skill_arrays_merged = array_merge($skill1_array, $skill2_array, $skill3_array); $skill_array = array_unique($skill_arrays_merged); sort($skill_array); foreach($skill_array as $skill) { if ($skill !== "") { echo "<option value" . $skill . ">" . $skill . "</option>"; } } [/code] Basically what does wrong is that I only get three items in the $skill_array when there should be five. Hope you can help. Thanks everyone for your contributions...
  11. Thanks for the reply... Let me make it a bit clearer. I have data in three columns in a mysql table and I need to put them all into one array. Then once they are in the one array I need to run  a array_unique on them to filter out any duplicates and then sort them alphabetically... Could you help.
  12. Dear anyone who can help, I am doing SELECT queries on a mysql db to retrieve three different columns as arrays. I then need to join these arrays, remove any duplicate entries and sort them alphabetically. Theoretically, this is possible.  However for me, it all falls down because I don't get all the data I would expect our of the mysql db. Has anyone had this problem?  Could anyone help? Many Thanks! Regards and Jesus Christ's blessings, Chris Cundill
×
×
  • 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.