Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. thanks the scripts are working great now thanks
  2. so I cannot do this? team[1]="<?php $row['1'] ?>"; rec[1]="(30-3)";
  3. I have a few questions. 1. How do I use php in the middle of JS for example: team[2]="<?php include ("example.php"); ?>"; rec[2]="(19-12)"; 2. How do I call rows form a MySQL table? I remeber the php is like: $_ROW['somthing'] but I do not remember, can anyone refresh my memory -Thanks
  4. lol was on the wrong page when I test this, sorry it works great
  5. I cannot find the my mistake, maybe a pair of fresh eyes will help here is how my table is setup Table Name: 1 id region w1a - w16a (w1a, w2a, etc..) l1a - l16a (l1a, l2a, etc..) 1-16 (1, 2, etc..) <?php /*Connect, and define user*/ include ("../../style/include/session.php"); error_reporting(E_ALL); /*Define Variables*/ $region = $_POST['region1']; $id = $_POST['id1']; $w1a = $_POST['w1a']; $w2a = $_POST['w2a']; $w3a = $_POST['w3a']; $w4a = $_POST['w4a']; $w5a = $_POST['w5a']; $w6a = $_POST['w6a']; $w7a = $_POST['w7a']; $w8a = $_POST['w8a']; $w9a = $_POST['w9a']; $w10a = $_POST['w10a']; $w11a = $_POST['w11a']; $w12a = $_POST['w12a']; $w13a = $_POST['w13a']; $w14a = $_POST['w14a']; $w15a = $_POST['w15a']; $w16a = $_POST['w16a']; $l1a = $_POST['l1a']; $l2a = $_POST['l2a']; $l3a = $_POST['l3a']; $l4a = $_POST['l4a']; $l5a = $_POST['l5a']; $l6a = $_POST['l6a']; $l7a = $_POST['l7a']; $l8a = $_POST['l8a']; $l9a = $_POST['l9a']; $l10a = $_POST['l10a']; $l11a = $_POST['l11a']; $l12a = $_POST['l12a']; $l13a = $_POST['l13a']; $l14a = $_POST['l14a']; $l15a = $_POST['l15a']; $l16a = $_POST['l16a']; $a1 = $_POST['1a']; $a2 = $_POST['2a']; $a3 = $_POST['3a']; $a4 = $_POST['4a']; $a5 = $_POST['5a']; $a6 = $_POST['6a']; $a7 = $_POST['7a']; $a8 = $_POST['8a']; $a9 = $_POST['9a']; $a10 = $_POST['10a']; $a11 = $_POST['11a']; $a12 = $_POST['12a']; $a13 = $_POST['13a']; $a14 = $_POST['14a']; $a15 = $_POST['15a']; $a16 = $_POST['16a']; function add($id, $region, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16) { $q = "INSERT INTO `1` VALUES ('$id', '$region', '$w1a', '$w2a', '$w3a', '$w4a', '$w5a', '$w5a', '$w6a', '$w7a', '$w8a', '$w9a', '$w10a', '$w11a', '$w12a', '$w13a', '$w14a', '$w15a', '$w16a', '$l1a', '$l2a', '$l3a', '$l4a', '$l5a', '$l6a', '$l7a', '$l8a', '$l9a', '$l10a', '$l11a', '$l12a', '$l13a', '$l14a', '$l15a', '$l16a', '$a1', '$a2', '$a3', '$a4', '$a5', '$a6', '$a7', '$a8', '$a9', '$a10', '$a11', '$a12', '$a13', '$a14', '$a15', '$a16')"; if ($result = mysql_query($q)) { return $result; } else { die(mysql_error() . "<br />" . $q); } } $q = "Select count(*) as row_count from `1` where id=1"; $r = mysql_query($q) or die(mysql_error()."<br /><br />".$q); if(mysql_num_rows($r) >0){ //Delete Row $query = "DELETE FROM `1` WHERE id = 1"; //Add to DB $result = mysql_query($query); add($id, $region, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16); } else{ //No rows, so add add($id, $region, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16); } ?> anyone see it?
  6. ah that is what it is, I have 50 cols in my table, and I have 51 listed here, alright I will have a look see
  7. yes I did, I made a function: function add($id, $region, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16){ $q = "INSERT INTO `1` VALUES ('$id', '$region', '$w1a', '$w2a', '$w3a', '$w4a', '$w5a', '$w5a', '$w6a', '$w7a', '$w8a', '$w9a', '$w10a', '$w11a', '$w12a', '$w13a', '$w14a', '$w15a', '$w16a', '$l1a', '$l2a', '$l3a', '$l4a', '$l5a', '$l6a', '$l7a', '$l8a', '$l9a', '$l10a', '$l11a', '$l12a', '$l13a', '$l14a', '$l15a', '$l16a', '$a1', '$a2', '$a3', '$a4', '$a5', '$a6', '$a7', '$a8', '$a9', '$a10', '$a11', '$a12', '$a13', '$a14', '$a15', '$a16')"; if ($result = mysql_query($q)) { return $result; } else { die(mysql_error() . "<br />" . $q); } } and it calls in here: $q = "Select count(*) as row_count from `1` where id=1"; $r = mysql_query($q) or die(mysql_error()."<br /><br />".$q); if(mysql_num_rows($r) >0){ $query = "DELETE FROM `1` WHERE id = 1"; $result = mysql_query($query); add($id, $region, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16); } else{ add($id, $region, $id, $w1a, $w2a, $w3a, $w4a, $w5a, $w6a, $w7a, $w8a, $w9a, $w10a, $w11a, $w12a, $w13a, $w14a, $w15a, $w16a, $l1a, $l2a, $l3a, $l4a, $l5a, $l6a, $l7a, $l8a, $l9a, $l10a, $l11a, $l12a, $l13a, $l14a, $l15a, $l16a, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $a12, $a13, $a14, $a15, $a16); } where did I go wrong? The table name is 1
  8. When I run my PHP script I get this error: what does it mean? How do I fix it?
  9. nope he has the right idea, thanks!
  10. I want to do this in PHP, so please do not hound me about posting in the wrong area How do I do a IF statement if a row exist? I want it to check if the row (in a table) exist and if it does delete it, and re add the new row, if it does not exist add the new row. -Thanks!
  11. duh solved, float: left; thanks anyways
  12. I have my ads under my logo, and makes my page look sorta messy I want it on the very left, but I have no idea on how to do this in CSS, I have the body tag, and a div.body tag, so I think I need it between there, but it puts it on the very top of all the content in linked image below is where I want it, but how do I do this? http://uploads.lamezz.com/hereads.bmp -Thanks !
  13. sorry I posted in PHP, but someone told me to post here, then they responded, so I kept it going as well, sorry Thanks!
  14. what if the row does not exist?
  15. Lamez

    One Row

    I know, but the row does not exist yet, that is what I am say
  16. Lamez

    One Row

    but it creates a row, then they can go back and edit that field. so what would the PHP code look like? I have never done anything like this
  17. Is there a way to make a table have only one row, and when a form is submitted that alters that table, it does not add a new row, but modifys the current one?
  18. Lamez

    One Row

    I know it doesn't, but I was saying I thought you had to do what I wanted to do in PHP. You do not have to be a jerk about it. I just do now know how to do this, and I would like it if someone pointed me in the right direction. -Thanks
  19. Lamez

    One Row

    I understand, but I thought you had to do this through php?
  20. Lamez

    One Row

    Is there a way to make a table have only one row, and when a form is submitted that alters that table, it does not add a new row, but modifys the current one?
  21. alright, I get this error now:
  22. there is no error, it is just not adding the submitted fields to the database.
  23. anyone, I did not think it would be that hard??
  24. I cannot get my fields to insert into the database, will someone check my code, and tell me if I have any mistakes? <?php /*Connect, and define user*/ include ("../../style/include/session.php"); /*Define Variables*/ $region = $_POST['region1']; $a1 = $_POST['1a']; $a2 = $_POST['2a']; $a3 = $_POST['3a']; $a4 = $_POST['4a']; $a5 = $_POST['5a']; $a6 = $_POST['6a']; $a7 = $_POST['7a']; $a8 = $_POST['8a']; $a9 = $_POST['9a']; $a10 = $_POST['10a']; $a11 = $_POST['11a']; $a12 = $_POST['12a']; $a13 = $_POST['13a']; $a14 = $_POST['14a']; $a15 = $_POST['15a']; $a16 = $_POST['16a']; /*Add to DB*/ mysql_query("INSERT INTO `1` (region, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) VALUES ('$region', '$a1', '$a2', '$a3', '$a4', '$a5', '$a6', '$a7', '$a8', '$a9', '$a10', '$a11', '$a12', '$a13', '$a14', '$a15, '$a16')"); echo $region; ?>
×
×
  • 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.