DarkShadowWing
Members-
Posts
79 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
DarkShadowWing's Achievements
Newbie (1/5)
0
Reputation
-
anyone?....
-
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
thats it! im closing this thread. im tired of u ppl making fun of me! -
Hi all. After lots of research, I finally got this darn code to work. The only problem is I don't know how to detect which user is banned on the website and which user is not, or which user has a warning, and which 1 does not. i want to detect which user is what by the user's 1st name, and last name. or should i make a table that hold's their ip? if so, how would i do that? a working example would be GREAT! Code: $query = "SELECT $warning1, $banned1 FROM $tbl;"; var_dump($query."<br>\n"); $result = mysql_query($query) or die(mysql_error()); //now lets go through every row returned. while($row = mysql_fetch_assoc($result)){ $warning = $row[$warning1]; $banned = $row[$banned1]; $rows = mysql_num_rows($result); echo "query: ".$query."<br>\n"; echo "result: ".$result."<br>\n"; echo "row: ".$row."<br>\n"; echo "warning: ".$warning."<br>\n"; echo "banned: ".$banned."<br>\n"; echo "rows: ".$rows."<br>\n"; if($warning > 0){ ANY help is GREATLY appreciated!
-
If I wanted to create a table in my database with TIMESTAMP DEFAULT CURRENT_TIMESTAMP, and wanted to check if the same person submitted data before the next day and send an error message depending on if 24 hours has passed on the same person, how would i do that? how could i use this "WHERE timesamp >NOW() +INTERVAL 1 DAY", to detect if its been 24 hours or not since that person's 1st submit? here's the table: <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?> ANY help is GREATLY appreciated!
-
Ok, using this code, can someone at least help me modify it to detect whether or not its 24 hours later since the 1st submit? <?php $thismonth = date("m"); if ($thismonth=="01") // list January's dates { echo "<ul id=\"dateslist\">"; echo "<li>Wed, 7th January</li>"; echo "<li>Wed, 14th January</li>"; echo "<li>Wed, 21st January</li>"; echo "<li>Wed, 28th January</li>"; echo "</ul>"; } elseif ($thismonth=="02") // list February's dates { echo "<ul id=\"dateslist\">"; echo "<li>Wed, 4th February</li>"; echo "<li>Wed, 11th February</li>"; echo "<li>Wed, 18th February</li>"; echo "<li>Wed, 25th February</li>"; echo "</ul>"; } ?> <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?>
-
Hi all. I need to know how after a person submits some data, that it will return an error message until the next day? Example: I submit my data. it returns an error message until the next day. then it lets me submit again. <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?>
-
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
hey kingphillip, no offense,but i DO have a friggin learning disability. It's called ADD and i dont CARE what u all think, Im NOT afraid to say it. -
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
good. anybody else who thinks my learning disability needs improvement? leave now.. -
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
i AM appreciative. You people don't seem to understand. I HAVE A LEARNING DISABILITY. and u bringing me out like that in front of the crowd. thats LOW... So I'm sorry if I don't understand u like u "want me to".. -
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
sheesh, u coulda been nice to me instead of all mean like that. -
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
well excuse me for barely being able to understand some of what YOU guys say to.. so i think im doing just fine. -
[SOLVED] HELP! Getting "Query was empty" error!
DarkShadowWing replied to DarkShadowWing's topic in PHP Coding Help
anyone?