-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
you are not defining anything, you are just telling it to print. I would guess using the JS board.
-
oh, that is a good one to add to my notes $ch['r'.$num.''] will come from the table rnd1_check from the row r1 - r32, just depending on the number also how did you make that font all colorful without using the code tags?
-
PHP HTML Email - not receiving on some servers.
Lamez replied to Shellfish's topic in PHP Coding Help
oh, that makes sense, I was wondering how a ISP had control over receiving HTML emails, unless they where the mail providers. -
I made a checkTable function, and its purpose is to find the row, and if the data is equal to 0 then show a drop down box, if not then show what is in another table, well it does neither, and I do not know why. Also this is one of my first functions, ever. here is the function: <?php $rnd = "rnd1_win"; $query = "SELECT * FROM `$rnd`"; $result = mysql_query($query); $win = mysql_fetch_array($result); $table = "rnd1_check"; $qu = "SELECT * FROM `$table`"; $re = mysql_query($qu); $ck = mysql_fetch_array($re); function checkTable($num, $a, $b){ if ($ch['r'.$num.''] === ("0")){ echo "<select>"; echo '<option value="emp"></option>'; echo '<option value="'.$a.'">'.$a.'</option>'; echo '<option value="'.$b.'">'.$b.'</option>'; echo '</select>'; }else{ echo $win[$a]; } } ?>
-
PHP HTML Email - not receiving on some servers.
Lamez replied to Shellfish's topic in PHP Coding Help
To my knowledge there is nothing you can do about this matter. It is on the other end, you would have to talk to the ISP. -
what he is asking is: Will this work if I test it?
-
lol I feel like adding <?php $var = "1"; if ($var === ("1")){ echo "var is equal to 1"; }else{ echo "var is not equal to 1": } ?>
-
Well noted, now I will revise and edit. Thanks!
-
why is that better? I would like to learn how to make a much better, and more stable code.
-
I got it, thanks to some logical thinking, and the mysql_num_rows here is my function: <?php function barView($var, $table){ $num = mysql_num_rows(mysql_query("Select `$var` From `$table`")); if ($num >= 1){ echo "there is somthing in the table"; }else{ echo "nothing in the table"; } } ?> in my other page: <?php barView(a1, rnd1); ?>
-
all I want to know if there is somthing in there or not, and if so then do not allow a drop down.
-
is there a way in PHP to check to see if a row has anything in it? I making a function, and I want it to check to see if there is anything in that row. if($session->isAdmin()){ function barView($var, $table){ $q = "Select `$var` From `$table`"; mysql_query($q); }
-
you might wanna look into MySQL databases
-
right I have that, but I am looking at the tie breaker. This will only be used if the two or more users have the same total.
-
I don't though the whole system is automatic, except for the admin input on the winners.
-
No, this is though for a basketball bracket. I have it made a little easier than that. The data (that users guess), go into 6 different tables, sorted by rounds. rnd1 rnd2 rnd3 rnd4 rad5 champ Now the actual winners go into 6 different tables as well. rnd1_win ... champ_win champ tables are like so: champ_win: id champ tb and champ: username champ tb I just am working on the tie breaker script.
-
ya I am not into sports at all, this is for my dad. The total score is the user score, the points they have made from their picks. The final score is the actually score, it is the team who won the championship score. The Tie breaker is if a user, and another user have the same total score, then it you check to see who is closet to the final score. Even if they have gone over.
-
why would I do that? I was thinking, what about a if statement?
-
I am working on a bracket website, and I have a Tiebreaker field. (I told you that to get a better understanding) now the tie breaker is to be used only if some one has the same total score, but say they think the final score will be 50, and the other user thinks it will be 65, but the final score is 70, how would I be able to declare the person that chose 65 as there final score the winner? Also say a person chose 90, and another person chose 95, but the final score was 62, how would I declare the person that chose the score with 90 the winner? So I was guessing I would need to use some kinda round function or something, what do you guys think?
-
you can do .htacess my webhost has a FAQ and it has that in it, here is what it says: since I was logged on with my account it uses www.lamezz.com, just replace it with yours, I have tried it before, and it works!
-
You know, I missed spelt the name of the table, I feel really dumb, I think I should go to bed. thanks guys!
-
alright I revised my code for a loop and I get this error: here is my new code: <?php include("style/include/session.php"); include ("style/include/cons/head.php"); echo '<div class="box">'; $result=mysql_query('SELECT * FROM userspoints'); while($row=mysql_fetch_array($result)){ $user=$row['user']; /*Pull Winners for Round 1*/ $q = mysql_query("Select * from `rnd1_win`"); $win=mysql_fetch_array($q); /*Pull User Picks for Round 1*/ $q = mysql_query("Select * from `rnd1` Where `username` = '$user'"); $pick=mysql_fetch_array($q); /*Pull Point Values for Round 1*/ $q = mysql_query("Select rnd1 from `points`"); $point=mysql_fetch_array($q); $value = $point['rnd1']; /*Pull User Points for Round 1*/ $q = mysql_query("Select `username`, `total`, `rnd1` from `userpoints` Where `username` = '$user'"); $usrpoint=mysql_fetch_array($q); $total = $usrpoint['total']; $rnd1 = $usrpoint['rnd1']; if ( $win['1'] == $pick['a1'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['2'] == $pick['a2'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['3'] == $pick['a3'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['4'] == $pick['a4'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['5'] == $pick['a5'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['6'] == $pick['a6'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['7'] == $pick['a7'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['8'] == $pick['a8'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['9'] == $pick['b1'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['10'] == $pick['b2'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['11'] == $pick['b3'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['12'] == $pick['b4'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['13'] == $pick['b5'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['14'] == $pick['b6'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['15'] == $pick['b7'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['16'] == $pick['b8'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['17'] == $pick['c1'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['18'] == $pick['c2'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['19'] == $pick['c3'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['20'] == $pick['c4'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['21'] == $pick['c5'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['22'] == $pick['c6'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['23'] == $pick['c7'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['24'] == $pick['c8'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['25'] == $pick['d1'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['26'] == $pick['d2'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['27'] == $pick['d3'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['28'] == $pick['d4'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['29'] == $pick['d5'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['30'] == $pick['d6'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['31'] == $pick['d7'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } if ( $win['32'] == $pick['d8'] ) { $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'"); } } //End Loop print '</div>'; include ("style/include/cons/foot.php"); ?>
-
This is why you do not program late at night. I forgot I change the field name from 1 to rnd1, lol thanks for your help!