Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Scratch whateveryone has been feedin ya. $Result = mysql_query("SELECT gold FROM users WHERE username='$username'"); $Row = mysql_fetch_array($Result ); if ($Row['gold'] < 50) { echo "You dont have enough gold to purchase a hoe!!"; die(); } else { } You were never checking the actual column.
  2. look into using nl2br when pulling the data out of the database.
  3. But why when DROP TABLE IF EXISTS is soo much simpler than doing that? lol
  4. Umm are you sure? The whole point of ob_start is to not have output echo until you use ob_end_clean type function to paste it to the screen.
  5. The IF EXISTS part is to throw an error. This is used mainly for development/installer scripts. Incase someone is re-installing or you dont want to alter your tables you can just drop the table if it exists then re-create it. I use it all the time in my installer scripts.
  6. $horseid is not defined, or whatever variable you are using. Check where it is being set and make sure it is in deed being set.
  7. Why not find out for yourself? http://dev.mysql.com/doc/refman/5.1/en/drop-table.html According to that, yes you can.
  8. Shared. Could that be the problem? Very well. Shared hosting is very unsecure and chances are you do not have alot of permissions on it. Thus you cannot set your own timeouts cause you cannot access the php.ini and probably cannot use the ini_set feature either. I bet the .htaccess version is also blocked for "Security" reasons by your host. Glad I have a dedicated server =)
  9. Eh sorry, I was looking at the wrong spot for the error proc_date of date(20) Was where the issue was being thrown, you cannot define the size of type date. proc_date date would work.
  10. That is an easy one. <?php $query = "SELECT DISTINCT VisIP FROM logs"; $res = mysql_query($query); $ipsToday = mysql_num_rows($res); echo "There have been " . $ipsToday . " unique visitors today."; ?> Just remember that IPs are not a good way of tracking "unique" visits due to networks such as schools or LAN's at home.
  11. <?php $stat = array("test" => array("extra" => array("bob" =>1), "bob2" => 2), "test2" => "test1"); $message = ""; echo "<pre>"; echo printMultiArray($stat); echo "</pre>"; function printMultiArray($array, $message="", $i=1, $recur=false) { $tmpMessage = str_pad($tmpMessage, $i, "\t"); if (is_array($array)) { foreach ($array as $key => $value ) { if (!$recur) $message .= "<br />[user-" . $key . "]<br />"; if (is_array($value)) { $message .= $tmpMessage . "[" . $key . "] -> " . $value . "<br />"; $message = printMultiArray($value, $message, ($i+1), true); }else { $message .= $tmpMessage . "[" . $key . "] -> " . $value . "<br />"; } } } return $message; } die(); ?> That should work with any size array. Got bored so yea decided to make it recursive. (Note that does the same thing as the following would): <?php $stat = array("test" => array("extra" => array("bob" =>1), "bob2" => 2), "test2" => "test1"); $message = ""; echo "<pre>"; $message = print_r($stat, 1); echo $message . "</pre>"; ?>
  12. I won't respond due to the lack of [ code] [ /code] tags (without the initial space) surrounding the code.
  13. You need to add session_start to the top of each page that uses session (before any output) for sessions to work.
  14. ORDER BY timestamp column.
  15. Add the following to the top of the code and see what error comes out. error_reporting(E_ALL); ini_set("display_errors", 1);
  16. I think you should be using single quotes for the enum line not backticks...
  17. Whats the error?
  18. The browser it self times out if no data is received after 5 minutes. It is better to import via command line instead of php due to this issue.
  19. Simple modification. <?php $query = "SELECT DISTINCT VisIP FROM logs"; $res = mysql_query($query); while ($row = mysql_fetch_assoc($res)) { echo $row['VisIP'] . " has entered at least once.<br />"; } ?> The count function is only needed if you actually want to count, this should produce what you want.
  20. First up, $HTTP_GET_VARS is depreciated. Use $_GET['action'] instead. Second up. if ( $action == "edit") { Parans need to be braces ( should be {
  21. <?php session_start(); if (isset($_SESSION['nsit_adminid'])) { $sqlusr=mysql_query("select * from $tbl_name where adminid='" . $_SESSION['nsit_adminid'] . "'"); if(!empty($sqlusr)) { $numusers=mysql_num_rows($sqlusr); if($numusers==1) { $usrrow=mysql_fetch_array($sqlusr); $lastname=$usrrow["lastname"]; $init=$usrrow["initials"]; } } } ?> You need to session_start at the top of each page you use sessions. I also do not see the "lastlogin" part in the code...
  22. simple_xml That is where I would start.
  23. Nope. $Body .= "<td width=\"200px\">Member Name</td><td width=\"400px\"> {$_POST['Member_Name']} </td>"; Like that. And please, please use the [ code] [ /code] tags (without the initial space) to surround code And a big note, that is to be used only inside of " (double quotes) to get it to display properly.
  24. Eh nm, just saw you were using mysqli. Why not loop through and print all the IDs and see what prints out/why it would stop at 9...
  25. <?php if (isset($_SESSION['nsit_adminid'])) { $sqlusr=mysql_query("select * from $tbl_name where adminid='" . $_SESSION['nsit_adminid'] . "'"); if(!empty($sqlusr)) { $numusers=mysql_num_rows($sqlusr); if($numusers==1) { $usrrow=mysql_fetch_array($sqlusr); $lastname=$usrrow["lastname"]; $init=$usrrow["initials"]; } } } ?> You never set $nsit_adminid, since you did not, you should access it via the session array as shown above.
×
×
  • 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.