Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. What do you mean by:
  2. I have to ask why you would even have those queries like that anyways... Why are you grabbing isReading/isPhysical if you already know what they are in the WHERE clause?
  3. Just do a separate mysql_fetch_assoc above your loop... // grab a row $row = mysql_fetch_assoc($qry); // do whatever with row, simple example below $ret .= '<tr><td>'.$row['title'].'</td></tr>'; while($row = mysql_fetch_assoc())
  4. I know a lot of the bigger sites use Comet If you want to just use AJAX, your only real option is to keep polling.
  5. IPv4 addresses are unsigned 32-bit integers, so you should store them as unsigned ints, not as chars. Note: if you use the ip2long function it will return a signed int, not unsigned.
  6. echo $_SERVER['PHP_SELF']; // note uppercase That should almost always work (unless you're running like before 4.3 - even so you really need to update your software ) Also, a blank action in a form defaults to the page it is on.
  7. haha good job. but if for some reason wordwrap is taken out of the core on your system, premiso's function should work hehe Oh and congrats on 5k posts
  8. Why not just use the last parameter of wordwrap? It'll cut long words if you pass true to its value echo wordwrap("cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccchghggggggggggggggggf",10, "<br />\n", true);
  9. Read the comments in the code... first one was your code, second is mine with updates. <?php // Grabs your request var $human = $_REQUEST["human"]; // Check to see if it is correct if (($human == "elvia" ) || ($human == "roger" ) || ($human == "dano1" )) { // Do a mysqli login $dbh = mysqli_connect("--"); //search for name in database // select the username $sql = ("SELECT * FROM artnet WHERE username = '.$human.' "); // run the query $query = mysqli_query($dbh, $sql); // if the query was successful (note: this does NOT check to see if the data returned was what you wanted) if ($query) { // echo a hello echo"YOU GET IN"; // insert into DB $sql2 = ("INSERT into artnet (username) VALUES ('$human')"); //or, YOU ALREADY GOT IN ONCE } else { // echo a deny echo"NAMES ALREADY HERE"; } } else { // Did not put the correct human. echo"DENIED"; } ?> <?php $human = $_GET['human']; // or $_POST if(in_array($human, array('elvia','roger','dano1'))) { // connect to mysqli $dbh = mysqli_connect('--'); // select the username // note the limit 1 will only allow 1 row to be returned (since thats all you need... will make it faster with large DBs) $sql = "SELECT * FROM artnet WHERE username = '".$human."' LIMIT 1"; // run the query: $query = mysqli_query($dbh, $sql); // you should run some error reporting here, but I won't put that in for you. // if we had a result if(mysqli_num_rows($query) > 0) { // that means the name was already in the DB echo "Name already here!"; } else { // name was not in the DB yet echo 'You get access!'; // Add to DB $query = "INSERT INTO artnet (username) VALUES ('".$human."')"; mysqli_query($dbh, $sql); } } else { // not in the allowed array, show error echo 'Invalid human'; } ?>
  10. Bah, maybe not. I'm seeing things in the Show new replies to your posts screen. Ignore me.
  11. I see this has been installed, yes?
  12. Contracts with limited revisions is a lifesaver.
  13. Related: http://googleblog.blogspot.com/2009/12/now-you-see-it-now-you-dont.html (even though it's kind of old news..) I don't mind it... but it kinda bugs me that it doesn't fade back out. I think if anything it should be 50% opacity & fade up to full & back to 50%
  14. <div class="story"> XXX A BUNCH OF PLAIN TEXT XXX <> Doing it to me too. WYSIWYG is off for me. Also running 3.0.195.33 Didn't we have this problem (with other text ofc) before? (can't find the specific link atm)
  15. Philip

    newbie

    Howdy - also from Texas Took a look at your site, some pretty nice clients you got there!
  16. Reading over this, you'd need these tables... unless you can have multiple divisions per team, or multiple teams per player: Divisions Teams Players
  17. If I understand it correctly, you're wanting to basically combine your UPDATE/SELECT queries...
  18. What about having a JS thing, where it shows like "A total of 10 people have been active in this thread" and then click to show who.
  19. Ignore this. The bg of the topic solved in the forums looked more white than green on my secondary monitor.
  20. I've just started getting into Stored Procedures/Functions, and love 'em. Great for keeping the db structure hidden
  21. Philip

    PHP FRESHBIE

    Welcome to phpfreaks, edmund. So long as you don't take a stick and poke the mods or admins in their cages, I'm sure you won't regret joining the forums. As you should notice he said mods or admins, but people like nrg_alpha who is just a recommended means you can poke as much as you feel like. I poke back.
  22. Its going to take some getting used to. Change is good, but at first typically people hate it.
  23. I'd die for those temps on my card... even when they are underclocked.
×
×
  • 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.