Jump to content

o3d

Members
  • Posts

    138
  • Joined

  • Last visited

    Never

About o3d

  • Birthday 03/30/1981

Profile Information

  • Gender
    Male
  • Location
    South-Africa

o3d's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not sure if this will work, but have a look at the query below, I added the "AND items..." section: SELECT * FROM items LEFT JOIN user_items ON items.item_id=user_items.item_id WHERE user_items.userid='$userid' AND items.item_id NOT IN ( SELECT primary_id FROM user_equipped_items WHERE userid='$userid' ) This will exclude all item_id's that is found in the user_equipped_items table. I'm also not sure if primary_id is the correct column? To come back to your original question on how to join, it gets complicated when you left join and then want to join another table to that table. Let me know if the above sql works, if not I'll rethink the query.
  2. Maybe try this: select * from dp, perso, center where dp.pid = perso.pid and center.pid = dp.pid order by dp.id asc Just remember that the same pid row data need to exist in all 3 tables else it won't work. Ps. try to use the sql keywords JOIN, etc when querying from multiple tables. It will save you a lot of debugging when you start working on larger queries: eg. select * from dp join perso on perso.pid = dp.pid join center on center.pid = dp.pid order by dp.id asc
  3. A very rough approach could be to put each <div class="data"> section into an array and then go through that array and find ITEMID. <?PHP $page_content_array = explode('<div class="data">', $page_contents); for ($i=0; $i<count($page_content_array); $i++) { $content_array = explode('/', $page_content_array[$i]); $content_array[5]; //this should contain the ITEMID for every <div class="data"> section } ?> this has not been tested
  4. o3d

    What is $i?

    $i, $j, $k, etc.. are used most frequently when looping through 'for' loops. I think it's just been adapted common practice over the years for easy reading.
  5. First off, are there any errors? Secondly check that your mail function returns with a true value. if (mail(...)) { header("Location: thankyou.php"); } else { echo 'could not send mail...<br />'; }
  6. date_default_timezone_set('Australia/Sydney'); http://nz2.php.net/manual/en/function.date-default-timezone-set.php
  7. To test wether a form or variable was submitted it is good practice to test with the following method: <?PHP if (isset($_GET['submit'])) { if (isset($_GET['score_1']) && $_GET['score_1'] != '' && isset($_GET['score_2']) && $_GET['score_2'] != '' && isset($_GET['score_3']) && $_GET['score_3'] != '') { if (do other checks ie. is_numeric... regexpr...) { //error echo "<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Please restrict your input to only numbers.</b></font><br>"; } else { //good to continue $avg=($_GET['score_1'] + $_GET['score_2'] + $_GET['score_3'])/3; if ($avg >= 29) { $total = 0; else $total = ((29 - $avg) * (7/10)); print("The freegumpher handicap is:". $total); } } else { //error echo "<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Oops, you forgot to supply some information. Please correct the problem below.</b></font><br>"; } } ?>
  8. Maybe replace the textarea in the form with a static value e.g. <input type="text" value="test123" name="suggestion" /> and submit that and check the table.
  9. SELECT * FROM articles WHERE link='http://www.theage.com.au/travel/travel-news/nerd-bird-flies-like-a-brick-20100326-r0eh.html'; You forgot to close the string with a single quote.
  10. Once the user is logged in, I assume you populate a global variable or a session variable. Say e.g. $_SESSION['city_id']. Then you could do this: <?PHP if ($loggedin) { ?> <form name="form1" method="post" action="<?php $_SERVER['PHP_SELF'];?>"> <select name="country"><option value="brazil" id="brazil">Brazil</option></select> <select name="city"><?PHP //loop through table of cities and check if city id == $_SESSION['city_id'] while () { echo '<option value="brazil" id="brazil" '.(city id == $_SESSION['city_id']?'selected':'').'>Brazil</option>'; } ?></select> <input type="submit" value="submit> </form> <?PHP } else { ?> <script> function show(){ if (document.form1.country.value == "Brazil") { document.getElementById('city').innerHTML = "<select name='mycity' id='mycity'><option value='ABC' id='ABC'>ABC</option></select>"; } } </script> <form name="form1" method="post" action="<?php $_SERVER['PHP_SELF'];?>"> <select name="country"><option value="brazil" id="brazil" onchange="show()">Brazil</option> <div id="city"></div> <input type="submit" value="submit> </form> <?PHP } ?> Please know that this is just a concept and has not been tested and is psuedo-ish. Hope this put you on the right track.
  11. change <select name="country"><option value="brazil" id="brazil" onchange= onchange="show()">Brazil</option> to <select name="country"><option value="brazil" id="brazil" onchange="show()">Brazil</option> btw my suggestion won't fix your problem, i'm just pointing out a problem.
  12. Just so you know this will create problems if you use the same property in a tag more than once. It uses the first instance and ignore the rest. Remove the first "onchange=" occurance. <select name="country"><option value="brazil" id="brazil" onchange= onchange="show()">Brazil</option>
  13. If you have to use megauploads' captcha then you might have to do some curl'ing. However if you don't need to use their captcha this project might do the trick: http://www.phpcaptcha.org/
  14. I don't think these forums are there to do your work for you, it exists purely as a form of help. Some of the developers here don't have time to test their code and purely submit concepts. That error is really easy to fix and if you can't fix that then I would suggest to download "php for dummies".
×
×
  • 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.