Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by Lamez

  1. I am a bit lost on your question. You can call files from different folders with php, and include them in the current script. Such as: <?php //in current dir. include("file.php"); //up a folder, a in the folder name: folder_name include("../folder_name/file.php"); ?> Maybe you can rephrase your question. -Lamez
  2. Okay, I am getting a error with my query. I am sure it's nothing, but I cannot find it. I just need a fresh pair of eyes. Here is the error: Here is the code: <?php $q = "INSERT INTO `reviews` (valid, key, ip, first, last, email, disp, review) VALUES ('".$valid."', '".$key."', '".$ip."', '".$fname."', '".$lname."', '".$email."', '".$disp."', '".$review."')"; mysql_query($q) or die(mysql_error()); ?> Oh, Here is the Database Structure: -Thanks Guys!
  3. My action script that adds points to the users, and updates the database is not doing any of the mysql querys, it has work times and times before, but not now for some reason. It does redirect, but it does not echo anything out. I have no idea why. Here is the code: <?php ob_start(); $path = "../../"; $title = "Update Winners"; $u_login = "yes"; $admin = "yes"; include ($path."main/include/cons/head.php"); if(siteStat() == "Basketball" && $basketReg == 0){ function getPnts($round){ $f = mysql_fetch_array(mysql_query("SELECT * FROM `basket_pnts` WHERE `round` = '".$round."'")); return $f['value']; } $i = 1; $cnt = 1; while($i<=16*4){ if($i <= 16*1){ $r = "a"; }else if($i <= 16*2){ $r = "b"; }else if($i <= 16*3){ $r = "c"; }else if($i <=16 *4){ $r = "d"; } $win = $_POST[$cnt."_".$r]; $spot = $cnt; $round = $_POST['round']; if(!empty($win)){ mysql_query("INSERT INTO `basket_winner` (team, region, spot, round) VALUES ('".$win."', '".$r."', '".$spot."', '".$round."')")or die(mysql_error()); $pnt = getPnts($round); $table = "basket_rnd".$round; $q = mysql_query("SELECT * FROM `".$table."` WHERE `".$spot."` = '".$win."' AND `region` = '".$r."'"); while($f = mysql_fetch_array($q)){ $usr = $f['user']; $p = mysql_query("SELECT * FROM `basket_usrpnts` WHERE `user` = '".$usr."'"); $p = mysql_fetch_array($p); $brnd = "rnd".$round; $rnd = $p[$brnd]; $total = $p['total']; $rnd+=$pnt; $total+=$pnt; mysql_query("UPDATE `basket_usrpnts` SET `".$brnd."` = '".$rnd."', `total` = '".$total."' WHERE `user` = '".$usr."'"); echo $table." ".$spot." ".$usr." ".$pnt; } } $i++; if($cnt <= 16){ $cnt++; }else{ $cnt = 1; } } //header("Location: up_win.php"); }else{ header("Location: ../index.php"); } include ($path."main/include/cons/foot.php"); ?>
  4. w00t, that worked, but now why does it not redirect? oh forgot the :
  5. so like: <?php mysql_query("INSERT INTO `basket_rnd1` (user, region, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`) [..] "); ?>
  6. I keep getting a mySql error, but I have no idea why, can someone help me look for the error? This is the Error: <?php mysql_query("INSERT INTO `basket_rnd1` (user, region, 1, 2, 3, 4, 5, 6, 7, VALUES ('".$user_."', '".$x."', '".$a."', '".$b."', '".$c."', '".$d."', '".$e."', '".$f."', '".$g."', '".$h."')") or die(mysql_error()); ?> Whole Code: <?php ob_start(); $path = "../../"; $title = "Basketball Bracket"; $rank = "yes"; $u_login = "yes"; include ($path."main/include/cons/head.php"); $y = $_SESSION['xz']; $end = "endRnd_on"; $end2 = "endRnd_on2"; $end3 = "endRnd_on3"; $end4 = "endRnd_on4"; if($y == $end || $y == $end2 || $y == $end3 || $y == $end4){ if($y == $end){ $region = 1; $x = "a"; $re = "b"; } else if($y == $end2){ $region = 2; $x = "b"; $re = "c"; }else if($y == $end3){ $region = 3; $x = "c"; $re = "d"; }else if($y == $end4){ $region = 4; $x = "d"; $re = "e"; }else{ header("Location: ?yyz=r112d"); } $a = $_POST['1']; $b = $_POST['2']; $c = $_POST['3']; $d = $_POST['4']; $e = $_POST['5']; $f = $_POST['6']; $g = $_POST['7']; $h = $_POST['8']; $i = $_POST['9']; $j = $_POST['10']; $k = $_POST['11']; $l = $_POST['12']; $m = $_POST['13']; $n = $_POST['14']; $o = $_POST['15']; mysql_query("INSERT INTO `basket_reg` (id, name) VALUES ('1','A')")or die(mysql_error()); mysql_query("INSERT INTO `basket_rnd1` (user, region, 1, 2, 3, 4, 5, 6, 7, VALUES ('".$user_."', '".$x."', '".$a."', '".$b."', '".$c."', '".$d."', '".$e."', '".$f."', '".$g."', '".$h."')") or die(mysql_error()); mysql_query("INSERT INTO `basket_rnd2` (user, region, 9, 10, 11, 12) VALUES ('".$user_."', '".$x."', '".$i."', '".$j."', '".$k."', '".$l."')") or die(mysql_error()); mysql_query("INSERT INTO `basket_rnd3` (user, region, 13, 14) VALUES ('".$user_."', '".$x."', '".$m."', '".$n."')") or die(mysql_error()); mysql_query("INSERT INTO `basket_rnd4` (user, region, 15) VALUES ('".$user_."', '".$x."', '".$o."')") or die(mysql_error()); header("Location index.php?region=".$re); }else{ echo "ERROR!"; } ?> <?php include ($path."main/include/cons/foot.php"); ?> Any Ideas? Thanks Guys
  7. sure if you want to look at my post in that perspective.
  8. take a look at servage, they have good hosting, there is a link in my sig. I get tons of space for DB's.
  9. I have modded my xbox and when I was starting I found another community, and they have tutorials on their website, so take a look here: http://www.xboxscene.com/tutorials.php
  10. China is top of the world with their economy, so they know what they are doing, and just because you are in the middle of it, does not give you a reason to complain. (run on ) Ya I live in America, and we Americans get what we want. I am sorry you live in a strict environment, but you do not have any reason in the world to break the rules, so get over it.
  11. Living in a strict environment is no excuse to break the rules every once and a while.
  12. Lamez


    Dreamweaver, but I have often heard of Notepad++ or something like that is good.
  13. I usually only post here when I am tired and cannot find the problem, but I think I will not be able to solve this one when I am mentally sober. This bit of code below is suppose to check to see if the user has added the other user as their friend, if so it will return a error message, well I do believe I tested it before, but that was before I added someone else as my friend, meaning you get the error no matter what when you have more than one friend! Does anyone know why? Code: <?php $f_id = findInfo($user, "id"); $q = mysql_query("SELECT * FROM `friends` WHERE `a` OR `b` = '".$f_id."'"); $f = mysql_fetch_array($q); if($f['a'] == $f_id){ $n == 1; }else{ if($f['b'] == $f_id){ $n == 1; }else{ $n == 0; } } if($n == 1){ echo "<b>".$user."</b> is your friend already"; } ?> findInfo function: <?php function findInfo($user, $what){ $q = mysql_query("SELECT * FROM `users` WHERE `username` = '".$user."'"); $f = mysql_fetch_array($q); return $f[$what]; } ?>
  14. I am trying to get my insert query to insert a 1 in the accept field, but it is add a 0 instead. Here is the code: <?php $me_id = findInfo($user_, "id"); $them_id = findInfo($a_usr, "id"); mysql_query("UPDATE `friends` WHERE `friend_id` = '".$them_id."' AND `user_id` = '".me_id."' SET `accept` = '1'"); mysql_query("INSERT INTO `friends` (user_id, friend_id, accept) VALUES('$me_id', '$them_id', '1')")or die(mysql_error()); echo "<b>".$a_usr."</b> has been added as your friend!"; ?> no errors are being returned. The update query works, but not the insert!
  15. lol, they should make it where the parents can add websites with like a master password, or some sort.
  16. You probably don't care at this point, but if you ever wanted to use the full domain name, you could just modify your hosts file (C:\Windows\System32\drivers\etc\hosts) to have your host name redirected to megatron. lol its a linux server!
  17. he deleted it, and added it to here: http://www.phpfreaks.com/forums/index.php/topic,232470.0.html
  18. thanks, but does anyone have like hotmail, or something else?
  19. follow this rule: http://www.phpfreaks.com/forums/index.php/topic,231599.0.html
  20. I do not understand what you mean by "normal practice" you can post a link to the script, and there are some testers here that will have a whack at it. Be sure you do follow this: http://www.phpfreaks.com/forums/index.php/topic,231599.0.html
  21. yes do not be afraid to get your hands dirty, and your mind going. It will help you a lot if you learn PHP and MySQL Databases. I am so glad I decided to learn, now I am a script junkie.
  • 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.