-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
INNER JOIN causing odd problem, PHP Problem I think!
Lamez replied to Lamez's topic in PHP Coding Help
anyone? -
INNER JOIN causing odd problem, PHP Problem I think!
Lamez replied to Lamez's topic in PHP Coding Help
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()); ?> -
<?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?
-
Is there a project that is 100% working on the first day?
Lamez replied to closed_tag's topic in Miscellaneous
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! -
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!
-
INNER JOIN causing odd problem, PHP Problem I think!
Lamez replied to Lamez's topic in PHP Coding Help
do I need to use a LEFT JOIN or a RIGHT JOIN? -
lol, I do it all the time!
-
I see, maybe this will help: http://www.phpied.com/file_get_contents-for-php4/
-
also, where is $num defined at?
-
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
-
you need to look into BBCODE, there are plenty of good scripts out there.
-
Peak on over at: http://us.php.net/preg_replace
-
why don't you just update your PHP?
-
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!
-
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>
-
1. Use the code tags please! 2. When in doubt, echo out! Echo out, $i
-
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?
-
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!
-
how to use it, let me see if I can get it to work to satisfy my needs.
-
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!
-
ya, I just forgot the refresh the page, lol
-
that fixed that, but now I am not able to get the total working.
-
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"); ?>
-
I use stylesheets, but something have to be done in tables, just to make it look "pretty"!
-
well, it returned 0. I know what I did. -Thanks