Jump to content

bluesoul

Members
  • Posts

    149
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

bluesoul's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $info_location = "inf-bin/bil/$current.dat"; if(!file_exists($info_location)) { /* display fallback image */ } else { /* do the other stuff */ }
  2. $_GET is typically used for variables in a query string at the end of a page. index.php?do=foo would assign $_GET['do'] = "foo";
  3. I'm not braining very well today (I blame the weather), I meant consecutive queries. If you don't append or die(mssql_get_last_message()) you could probably miss that message. I read an article when I was first getting acclimated to MSSQL and it presented some really bizarre scenario that could make it not work. I don't have the link anymore but I don't think it's anything to fret over either, lol.
  4. Yeah, it sounds weird but in practice it works the same when used with die() or exit(). Only if you're doing concurrent queries will you introduce the possibility of it not displaying correctly and if that's going on you should probably rethink your code.
  5. your use of or die() doesn't make sense in this context. It'll still return a result, only with 0 rows, if the query is built correctly. But your query needs to look like this: $query = "SELECT * FROM table WHERE username = '$username' and password = '$password'"; $result = mysql_query($query,$dbh) or die(mysql_error());
  6. mssql_get_last_message() is no less reliable than mysql_error(). I've never had a problem with it.
  7. You wouldn't have to modify any code, it's simply a matter of convenience to have the username stored as a variable. It's not overwriting your 'priv' element.
  8. Although you may be right, if javascript is turned off, anyone can submit anything to that page without having it validated. More than likely, but I've had scant luck getting PHP to pop-up validation errors on-the-fly. Either way, the OP needs to at least take a stab at making it work.
  9. Something tells me it has to do with your use of ch$count, PHP isn't gonna know what that is. Perhaps ch.$count will work but I think you'll need to rethink your logic there. Also you can use $PositiveFirstCriteria++ instead of += 1. Same thing for $count.
  10. JavaScript is much more useful than PHP in this as you won't have to submit the page and then fool with variables and stuff. See this for form validation.
  11. <?php include("config.inc.php"); $result = mysql_query("SELECT * FROM gallery_photos"); $i = 0; While($row = mysql_fetch_array($result)){ if($i == 3) { echo "<br />"; $i = 0; } //change 3 to however many you want per row echo "<a href='photos/" . $row['photo_filename'] . "'><img src='photos/tb_" . $row['photo_filename'] . "' border='1' /></a>"; $i++; } ?>
  12. Take a look at date() and you should find the exact method of displaying that you want.
  13. $query = "SELECT Question, Answer, Number FROM table ORDER BY Number";
  14. I tried it and got Well there's the problem obviously.
×
×
  • 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.