premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
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.
-
look into using nl2br when pulling the data out of the database.
-
[SOLVED] drop table if exists question
premiso replied to dennismonsewicz's topic in PHP Coding Help
But why when DROP TABLE IF EXISTS is soo much simpler than doing that? lol -
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.
-
[SOLVED] drop table if exists question
premiso replied to dennismonsewicz's topic in PHP Coding Help
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. -
[SOLVED] Need help with allowing multiple enteries.
premiso replied to kendallkamikaze's topic in PHP Coding Help
$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. -
[SOLVED] drop table if exists question
premiso replied to dennismonsewicz's topic in PHP Coding Help
Why not find out for yourself? http://dev.mysql.com/doc/refman/5.1/en/drop-table.html According to that, yes you can. -
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 =)
-
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.
-
[SOLVED] I want to be able to count an item once using COUNT(*)
premiso replied to jeger003's topic in PHP Coding Help
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. -
<?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>"; ?>
-
I won't respond due to the lack of [ code] [ /code] tags (without the initial space) surrounding the code.
-
You need to add session_start to the top of each page that uses session (before any output) for sessions to work.
-
ORDER BY timestamp column.
-
Add the following to the top of the code and see what error comes out. error_reporting(E_ALL); ini_set("display_errors", 1);
-
I think you should be using single quotes for the enum line not backticks...
-
Whats the error?
-
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.
-
[SOLVED] I want to be able to count an item once using COUNT(*)
premiso replied to jeger003's topic in PHP Coding Help
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. -
[SOLVED] Parse error: syntax error, unexpected ';'
premiso replied to hellonoko's topic in PHP Coding Help
First up, $HTTP_GET_VARS is depreciated. Use $_GET['action'] instead. Second up. if ( $action == "edit") { Parans need to be braces ( should be { -
<?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...
-
simple_xml That is where I would start.
-
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.
-
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...
-
<?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.