Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by Lamez

  1. I found the problem! I forgot the where clause, but when I add it nothing is being pulled from the DB at all! Any ideas? <?php $q = mysql_query("SELECT foot_picks.* FROM foot_picks INNER JOIN foot_bowls ON foot_picks.id = foot_bowls.id WHERE foot_picks.user = '".$u."' ORDER BY foot_bowls.id")or die(mysql_error()); ?>
  2. <?php $title = "My Page"; echo '<html>'; echo pageTitle($title); echo '<body>Ya My Body!</body></html>'; function pageTitle($title){ $t = '<head><title>'.$title.'</title></head>'; return $t; } ?> returns like: <html><head><title>My Page</title><body>Ya My Body!</body></html> Something like that?
  3. Planning -> Design -> Development -> Testing -> Gets Angry, Adds Features -> Design phase 2 -> Testing -> Product Reviews -> Fixing Bugs -> Almost to the Point of Giving Up -> Finally Fixed Bugs -> Wait, Found More Bugs -> Repeat Last Couple of Steps -> Maybe Release You guys forgot a couple!
  4. lmao! Oops I was reading the manual, and I did not read his question at all. I just assumed when I saw the example he gave. My Bad!
  5. I see, maybe this will help: http://www.phpied.com/file_get_contents-for-php4/
  6. also, where is $num defined at?
  7. Look at JavaScript, I remember trying to something like this a while back. http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=JS+to+print+certain+area+of+a+page&spell=1
  8. you need to look into BBCODE, there are plenty of good scripts out there.
  9. Peak on over at: http://us.php.net/preg_replace
  10. why don't you just update your PHP?
  11. can you explain the function of grep? I found this: http://us.php.net/manual/en/function.preg-grep.php always take a look at: www.php.net, it is your best friend!
  12. try this: <?php include('layout.inc'); ?> <div style="position:absolute; top:110; left:252; width:500; height:300; z-index:1;"> <p> <?php $servername= "localhost"; $dbusername = "poetgos7_poetic"; $dbpassword = "poetic"; $dbname = "poetgos7_users"; $connection = mysql_connect($servername, $dbusername, $dbpassword); $db = mysql_select_db($dbname, $connection); $name = $_POST['username']; $password = $_POST['password']; $password2 = $_POST['password2']; $email = $_POST['email']; $ip = $_POST['ip']; //if else (else if) if($name == false || $password == false || $password2 == false || $email == false){ echo "You did not fill out all the required fields. Please hit the back button and try again!"; } if ($password != password2){ echo "The passwords did not match! Please hit the back button and try again!"; }else{ $connection = mysql_connect($servername, $dbusername, $dbpassword); $db = mysql_select_db($dbname, $connection); $sql = "INSERT INTO members (username, password, email, ip) VALUES ($username, $password, $email, $ip)"; $result = mysql_query($sql); echo "Thank you for your registration to poetichotline.org!"; } ?> </div>
  13. 1. Use the code tags please! 2. When in doubt, echo out! Echo out, $i
  14. Ok I just created a INNER JOIN mysql query, and now it is causing a odd problem. This script is on the profile page, and it see if the user got the football team right, and if so it puts a check by the team name, and the point value. Well all the last game it shows everyone got it right, and it shows they got the points, but most did not. Why? Here is the main code: <?php if(siteStat() == "Football"){ $q = mysql_query("SELECT foot_picks.* FROM foot_picks INNER JOIN foot_bowls ON foot_picks.id = foot_bowls.id ORDER BY foot_bowls.id"); echo '<table width="100%" border="0"> <tr> <td width="25%"><strong>Bowl Name </strong></td> <td width="25%"><strong>Pick</strong></td> <td width="25%"><strong>Correct</strong></td> <td width="25%"><center><strong>Points Earned</strong></center></td> </tr>'; while($r = mysql_fetch_array($q)){ $ts = mysql_query("SELECT * FROM `foot_win` WHERE `bowl_name` = '".$r['bowl_name']."'"); $t = mysql_num_rows($ts); $pn = mysql_fetch_array($ts); $v = mysql_query("SELECT * FROM `foot_win` WHERE `team` = '".$r['team']."'")or die(mysql_error()); $v = mysql_num_rows($v); $pa = mysql_query("SELECT * FROM `foot_bowls` WHERE `name` = '".$pn['bowl_name']."'")or die(mysql_error()); $p = mysql_fetch_array($pa); if($t > 0){//1st IF if($v > 0){//Second IF $s = '<img src="'.$path.'main/style/img/c.png" />'; $pnt = $p['pnt_val']; }else{//Second IF $s = '<img src="'.$path.'main/style/img/r.png" />'; $pnt = "0"; }//Secon IF }else{//1st IF $s = ""; $pnt = ""; }//1st IF $id = mysql_query("SELECT * FROM `foot_bowls` WHERE `name` = '".$r['bowl_name']."'"); $id = mysql_fetch_array($id); $id = $id['id']; ?> <tr> <td><a href="<?php echo $path;?>user/foot/bowl.php?bowl_id=<?php echo $id; ?>"><?php echo $r['bowl_name']; ?></a></td> <td><?php echo $r['team']; ?></td> <td><?php echo $s; ?></td> <td><center><?php echo $pnt; ?></center></td> </tr> <?php }//end 1st loop echo '</table></p>'; //Other Site Settings... }else if(siteStat() == "Basketball"){ echo "BSKT"; }else{ echo "No Pools are Open"; } } ?> Its the mysql querys at the beginning, but I think the main problem is that inner join query, does anybody have any idea why?
  15. holy crap, I did it! I used this: <?php mysql_query("SELECT foot_picks.* FROM foot_picks INNER JOIN foot_bowls ON foot_picks.id = foot_bowls.id ORDER BY foot_bowls.id"); ?> -Thanks!
  16. how to use it, let me see if I can get it to work to satisfy my needs.
  17. Ok I hidden another easter egg on one of my sites, lets see who can find it! http://krazypicks.com you do not need to login\register to find it!
  18. that fixed that, but now I am not able to get the total working.
  19. The idea behind this bit of code is to take the previous submitted information, which are the winners of the foot bowl, then to find all the users that have picked that team to win. If they did pick that team, then it will (suppose) take the pnt value, and add it to the db in the foot_picks table, then take their total, and it it there, and update the foot_pnt table. Well nothing is being updated at all! here is the buggy code: <?php ob_start(); $path = "../../"; $u_login = "yes"; $admin = "yes"; $rank = "yes"; include ($path."main/include/cons/head.php"); $name = $_POST['name']; $team = $_POST['team']; $pnt = $_POST['pnt']; $q = mysql_query("SELECT * FROM `foot_picks` WHERE `team` = '".$team."' AND `bowl_name` = '".$name."'"); while($f = mysql_fetch_array($q)){ mysql_query("UPDATE `foot_picks` WHERE `team` = '".$team."' SET `pnt` = '".$pnt."'"); $t = mysql_query("SELECT * FROM `foot_pnt` WHERE `user` = '".$f['user']."'"); $n = mysql_fetch_array($t); $tot = $n['total'] + $pnt; mysql_query("UPDATE `foot_pnt` WHERE `user` = '".$f['user']."' SET `total` = '".$tot."'"); } echo "All Done!"; include ($path."main/include/cons/foot.php"); ?>
  20. I use stylesheets, but something have to be done in tables, just to make it look "pretty"!
  21. well, it returned 0. I know what I did. -Thanks
  • 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.