-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
tyvm :D <?php $q = mysql_query("SELECT * FROM `users` WHERE `username` = '$session->username'"); $row = mysql_fetch_array($q); $ban = $row['ban']; if ($ban == (1)){ echo "Username is Banned!"; exit; } ?>
-
is there a way I could make the rest of the page from loading? for example <?php $q = mysql_query("SELECT * FROM `users` WHERE `username` = '$session->username'"); $row = mysql_fetch_array($q); $ban = $row['ban']; if ($ban == (1)){ echo "Username is Banned!"; //somthing to make the rest of the page from loading... } ?>
-
oh I understand now, so instead of doing this: mysql_query("UPDATE `users` SET `paid` = '0' WHERE `username` = '$user'"); I could do this w/o a loop?: mysql_query("UPDATE `users` SET `paid` = '0'");
-
isn't that what I have? mysql_query("UPDATE `users` SET `paid` = '0' WHERE `username` = '$user'");
-
I want a loop that will take ever user, and write a 0 in the paid column. I wanna make sure I got this down, so here is what I have: <?php if ($paid == ($_POST['paid'])){ $results = mysql_query("SELECT `username`, `paid` FROM `users`") while($row = mysql_fetch_array($result)){ $user = $row['username']; mysql_query("UPDATE `users` SET `paid` = '0' WHERE `username` = '$user'"); } } ?> would this work?
-
I am doing a large project as well as you are. It has taken me months, and almost through. It has gave me a lot of experience. I learned if you can do some basic IF, ELSE and MySql querys you good have a decent running website. here is a if statement: <?php $user = "Lamez"; if ($user == ("Lamez")){ echo "The user is Lamez"; }else{ echo "The user is not Lamez"; } ?> You need to memorize your querys. Just really learn some basics, and you will be good for a head start. -Good Luck
-
How would I make vertical text? Should I go CSS, I bet JS is the best way to go. Example: T E X T -Thanks
-
just have each image have a certain value. Then you can go based off of that value.
-
what about <?php $q = "SELECT * FROM `drawings`"; $r = mysql_query($q); $row = mysql_fetch_array($r); $title = $row['title']; $file = $row['file']; echo '<a href="'.$file.'">'.$title.'</a>'; ?> would that work for ya?
-
Wow that fixed it, thanks.
-
yep. I looked and made sure the information match to the user. But I am only get one user to output. I do not know why.
-
I did not think this would be hard for the experts out there. Any Idea?
-
My loop is only displaying one user, how do I get it to display all records? The information is coming from three different tables. The loop is coming out of userpoints. here is the code: <?php include ("../../style/include/session.php"); include ("../../style/include/cons/head_2.php"); print '<div class="box">'; if($session->logged_in){ include ("../../style/include/checkuser.php"); ?> <table width="100%" border="0"> <tr> <td> </td> <td><strong>Username</strong></td> <td><strong>Store # </strong></td> <td><strong>2nd Round </strong></td> <td><strong>Sweet 16 </strong></td> <td><strong>Elite 8</strong></td> <td><strong>Final 4 </strong></td> <td><strong>Finals</strong></td> <td><strong>Championship</strong></td> <td><strong>Tie Breaker </strong></td> <td><strong>Total</strong></td> </tr> <?php $q = "SELECT * FROM `userpoints` ORDER BY `total`"; $r = mysql_query($q); while ($rs=mysql_fetch_array($r)){ $q = "SELECT * FROM `users` WHERE `username`='".$rs['username']."'"; $r = mysql_query($q); $re = mysql_fetch_array($r); $q = "SELECT * FROM `champ` WHERE `username`='".$rs['username']."'"; $r = mysql_query($q); $tb = mysql_fetch_array($r); ?> <tr> <td> </td> <td><?php echo $rs['username']; ?></td> <td><?php echo $re['store']; ?></td> <td><?php echo $rs['rnd1']; ?></td> <td><?php echo $rs['rnd2']; ?></td> <td><?php echo $rs['rnd3']; ?></td> <td><?php echo $rs['rnd4']; ?></td> <td><?php echo $rs['rnd5']; ?></td> <td><?php echo $rs['champ']; ?></td> <td><?php echo $tb['tb']; ?></td> <td><?php echo $rs['total']; ?></td> <? } ?> </tr> </table> <?php }else{ include ("../../style/include/cons/member.php"); } print '</div>'; include ("../../style/include/cons/foot.php"); ?>
-
another thing, what exactly are arrays good for? I love using , but that is the only array I have ever used
-
well you could do this <?php $r = mysql_query("SELECT * FROM `users`"); $row = mysql_fetch_array($r); if ($_POST['username'] !== ($row['username'])){ mysql_query("INSERT INTO `users` VALUES ('$_POST['username']', '$_POST['password']')"); }else{ echo "username exist"; } ?> you might want to add a loop. I am not sure if this code works.
-
you could look here: http://www.hotscripts.com/PHP/Scripts_and_Programs/Randomizing/Random_Images/index.html
-
<?php $test = $_GET['page']; if ($test == ("page" && "this")){ echo "ya you found the page"; }else{ echo "nothing here"; } ?> would that work out as: ?page&this
-
hmm, well I would never pass information via URL, I do though use post data. Well thanks for the information guys. I will have to look at that link on variables. But what I set would it work?
-
make a link like this <?php echo '<a href="page.php">page</a>'; ?>
-
I know that, but how do I do this ?action=page&somthing
-
1.Variables, could I do this: <?php $var = "cat"; echo "I love $var"; $var ="dog"; echo "I love $var"; ?> and the output will be I love cat I love dog 2.How do I do this page.php?action=members&user or page.php?action=login&pass&user or somting like that
-
omg, after weeks of frustration, I have finally figured out a solution. if anyone is wondering, here is my full code: <?php include ("../../../style/include/session.php"); include ("../../../style/include/cons/head_3.php"); if($session->isAdmin()){ $a1 = $_POST['a1']; $a2 = $_POST['a8']; $a3 = $_POST['a5']; $a4 = $_POST['a4']; $a5 = $_POST['a6']; $a6 = $_POST['a3']; $a7 = $_POST['a7']; $a8 = $_POST['a2']; $b9 = $_POST['b1']; $b10 = $_POST['b8']; $b11 = $_POST['b5']; $b12 = $_POST['b4']; $b13 = $_POST['b6']; $b14 = $_POST['b3']; $b15 = $_POST['b7']; $b16 = $_POST['b2']; $c17 = $_POST['c1']; $c18 = $_POST['c8']; $c19 = $_POST['c5']; $c20 = $_POST['c4']; $c21 = $_POST['c6']; $c22 = $_POST['c3']; $c23 = $_POST['c7']; $c24 = $_POST['c2']; $d25 = $_POST['d1']; $d26 = $_POST['d8']; $d27 = $_POST['d5']; $d28 = $_POST['d4']; $d29 = $_POST['d6']; $d30 = $_POST['d3']; $d31 = $_POST['d7']; $d32 = $_POST['d2']; $result=mysql_query('SELECT * FROM userpoints'); while($row = mysql_fetch_array($result)){ $user = $row['username']; /*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']; #A's if ($a1 !== ("emp")){ if ($win['1'] == ("emp")){ if ($a1 == ($pick['a1'])){ $total = $value + $total; $rnd1 = $value + $rnd1; mysql_query("UPDATE `userpoints` SET `total`='$total', `rnd1`='$rnd1' WHERE `username`='$user'")or die(mysql_error()); } } } } $q = "UPDATE `rnd1_win` SET `1` = '$a1', `2` = '$a2', `3` = '$a3', `4` = '$a4', `5` = '$a5', `6` = '$a6', `7` = '$a7', `8` = '$a8', `9` = '$b9', `10` = '$b10', `11` = '$b11', `12` = '$b12', `13` = '$b13', `14` = '$b14', `15` = '$b15', `16` = '$b16', `17` = '$c17', `18` = '$c18', `19` = '$c19', `20` = '$c20', `21` = '$c21', `22` = '$c22', `23` = '$c23', `24` = '$c24', `25` = '$d25', `26` = '$d26', `27` = '$d27', `28` = '$d28', `29` = '$d29', `30` = '$d30', `31` = '$d31', `32` = '$d32' WHERE `id` = '1'"; mysql_query($q) or die(mysql_error()); print '<div class="box"><h2>Winners Updated</h2>'; print '<p>Winners Updated for Round 2<br><br>'; print '<a href="slcwin_1.php">Round 2</a></p>'; print '</div>'; }else{ header("Location: ../../../index.php"); } include ("../../../style/include/cons/foot.php"); ?> It works how I want it to
-
Newbie Question. Job Posting Board like Monster based off credit system?
Lamez replied to Timmay's topic in PHP Coding Help
I would think about using a DB, and a lot update querys. -
ya I do this $value = $_POST['value']; echo "This is my value: $value";