Jump to content

HaZaRd420

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by HaZaRd420

  1. Yep. It worked out. Thanks alot man. I've actually learned from a few mistakes and caught my self!. Thanks.
  2. Take the $ "From // if ($_POST["$submit"]) \\" on line 1 out of submit and it will work. <? if ($_POST["$submit"]) { $Forename = $_POST["Forename"]; $Surname = $_POST["Surname"]; $CurrentGrade = $_POST['CurrentGrade']; $DateAcheived = $_POST['DateAcheived']; $LicenseNumber = $_POST['LicenseNumber']; $LicenseExpiry = $_POST['LicenseExpiry']; $DateOfBirth = $_POST['DateOfBirth']; $MedicalProblem = $_POST['MedicalProblem']; $Medication = $_POST['Medication']; $CriminalRecord = $_POST['CriminalRecord']; $Address = $_POST['Address']; $Postcode = $_POST['Postcode']; $Phone = $_POST['Phone']; $Mobile = $_POST['Mobile']; $Email = $_POST['Email']; $Occupation = $_POST['Occupation']; $sql = "UPDATE $table SET Forename='$Forename',Surname='$Surname',CurrentGrade='$CurrentGrade',DateAcheived='$DateAcheived',LicenseNumber='$LicenseNumber',LicenseExpiry='$LicenseExpiry',DateOfBirth='$DateOfBirth',MedicalProblem='$MedicalProblem',Medication='$Medication',CriminalRecord='$CriminalRecord',Address='$Address',Postcode='$Postcode',Phone='$Phone',Mobile='$Mobile',Email='$Mobile',Occupation='$Occupation' WHERE id=$id"; $result = mysql_query($sql); echo "Thank you! Information updated."; } } ?>
  3. Here is the page I want to link it to. Is this the Output? <? include("header.php") ?> <table width="100%" cellspacing="0px" cellpadding="0px"> <tr class="newstop"> <td class="news"> TEAMROSTER <br /> <td class="news2">Category: Roster</td> </tr> <tr> <td colspan="100%" class="newstext"> <center> <? //connect to mysql //change user and password to your mySQL name and password mysql_connect("#","#","#"); //select which database you want to edit mysql_select_db("#"); //select the table $result = mysql_query("select * from roster"); //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $handle=$r["handle"]; $img=$r["img"]; $name=$r["name"]; $exp=$r["exp"]; $location=$r["location"]; $config=$r["config"]; $manufacture=$r["manufacture"]; $cpu=$r["cpu"]; $videocard=$r["videocard"]; $memory=$r["memory"]; $monitor=$r["monitor"]; $headphones=$r["headphones"]; $keyboard=$r["keyboard"]; $mouse=$r["mouse"]; $id=$r["id"]; //display the row echo " <table width=\"100%\" cellspacing=\"2px\" cellpadding=\"2px\"> <tr> <td colspan=\"100%\"><center><img src=\"$img\" width=\"83px\" height=\"101px\"></td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Handle</td> <td class=\"menutext\">$handle</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Name</td> <td class=\"menutext\">$name</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Experience</td> <td class=\"menutext\">$exp</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Location</td> <td class=\"menutext\">$location</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Config</td> <td class=\"menutext\">$config</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Manufacture</td> <td class=\"menutext\">$manufacture</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >CPU / Processor</td> <td class=\"menutext\">$cpu</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >VideoCard</td> <td class=\"menutext\">$videocard</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Memory</td> <td class=\"menutext\">$memory</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Monitor</td> <td class=\"menutext\">$monitor</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Headphones</td> <td class=\"menutext\">$headphones</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Keyboard</td> <td class=\"menutext\">$keyboard</td> </tr> <tr style=\"font-size: 11px;\"> <td bgcolor=\"#000000\" width=\"45px\" class=\"menutop\" >Mouse</td> <td class=\"menutext\">$mouse</td> </tr> </table> "; } ?><br /> <center> - - <a href="index.php?id=roster">Take me back!</a> - - </td> </tr> </table> <? include("footer.php") ?>
  4. Heres my code. I tried it. and nothing came up all that gets added to the url is view= / and the page i have the rest of the info on is info.php <? mysql_connect("localhost","#","#"); mysql_select_db("noob_roster"); $result = mysql_query("select * from roster ORDER BY handle DESC LIMIT 20"); while($r=mysql_fetch_array($result)) { $handle=$r["handle"]; $name=$r["name"]; $location=$r["location"]; $id=$r["id"]; echo "<tr style=\"background: #ffffff; padding: 2px; color:#1c1c1c;\"> <td style=\"border: 1px solid #ffffff;\">$handle</td> <td style=\"border: 1px solid #ffffff;\">$name</td> <td style=\"border: 1px solid #ffffff;\">$location</td> <td style=\"border: 1px solid #ffffff;\"><a href=\"?view=".$result[id]."\">View</a></td> </tr>"; } ?>
  5. So Ive made my roster page. It displays only 3 things from the database which are, Name, handle and location . Then I have a link that says View. - The view is to view there profile. I Dont know how to set it up to where I can click on that view and it will select the right id and show the remaining information like computer specs ect.. Thanks for your time.
  6. Can you show what it looks like in code? pls thnx
  7. Could I make the id time stamp? or will that mess with the id #'s
  8. I want to be able to submit and then have my text that I submited to the database, and actually put the old ones on the bottom and the new ones on top. Some how its the other way around... Is there a code for this in the php on the page or the mysql order? Thanks.
  9. Ehhhh, I guess I will figure somthing out. Just seems somthings get to hard when there easy. :P thanks much radar.
  10. Im not advanced at php but you should set the thumbnail image height and width (make it smaller ). Then set the default height and width when you want to view the image. Hope this helps.
  11. Learn PHP. Its a great programing language to be able to do what you want to. To get started www.php.net. Or you can search for already made scripts for what you want if you dont want to learn php.
  12. But I already have a table with what I want on it. I dont see why I can take the existing and input it that way then making a whole new table.
  13. Yes radar. Thats exactly what im getting at. So is this possible?
  14. Well not edit the ID but im saying point the Login to the ID so I can edit the rest of the fields.
  15. ewwwwww MY EYES. It does hurt.
  16. Hello all, This may be confusing and if you dont want to help that is fine with me. What I am trying to get at is to be able to login to a set ID that already has the name and set a password to it so the person will be able to edit there ID ( whats all in that certain id ). If I explained this to where you can not understand it, I will try to rephrase it for you, But hopefuly you will get what I am saying. I dont care about setting cookies or anything, I was just wondering if there is a quick way of doing this which Im sure there is. Thanks.
  17. Sweet man I got it! Thanks alot for sparing your time to help me joquius. I may ask you for a few more questions in the future. Do you have any sort of instantmessaging program? if so contact me with a pm or somthing ! Thanks alot.
  18. K so escaping php is that a differnt method? if so, the if ($page) would be the name of my page that im creating?
  19. I am having trouble with my code and getting an error on a line that just has </html> on it. [code]<?php $func = $_GET["func"]; $id = $_GET["id"]; //hazards test// include('config.php'); $rs = mysql_connect( "$host","$user","$pass" ) or die(mysql_error()); $rs = mysql_select_db( "$db" ); $rs = mysql_query($sql) or die(mysql_error()); if($func === 'view') { $sql="SELECT * FROM news where id='1'"; $rs = mysql_query($sql_staff) or die(mysql_error());   echo" <table id=\"Table_01\" width=\"314\" height=\"100\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">     <tr>         <td>         <table background=\"box2/images/index_01.gif\" width="314" height=\"23\"> <tr> <td><b>'.$row["subject"].'</b><br><br><div align=\"right\">Posted by : <b><u>'.$row["author"].'</u></b> on <i>'.$row["date"].'</i></div></td> </tr> </table>             </td>     </tr>     <tr>         <td>         <table background=\"box2/images/index_02.gif\" width=\"314\" height=\"72\" cellpadding=\"5\"> <tr valign="top"> <td> '.$row["content"].' </td> </tr> </table>             </td>     </tr>     <tr>         <td>             <img src=\"box2/images/index_03.gif\" width=\"314\" height=\"5\" alt=\"\"></td>     </tr> </table> '; } ?>[/code] any way someone can sort this out for me? All i want to do is display the data from that row. But im gettiing this error // Parse error: syntax error, unexpected $end in /data/11/0/78/25/730677/user/745722/htdocs/gau/test/news.php on line 99 thanks.
  20. Hello, I want to know how would i code to see the number of ID's inside of the database, For example... I have a roster with 8 people, I want it to say at the very top, We have currently 8 members, Will this work from going from the ID or? Please help me kthnkx.
×
×
  • 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.