Jump to content

fallenangel1983

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fallenangel1983's Achievements

Member

Member (2/5)

0

Reputation

  1. So this is what i got so far echo "<b><center><h1>Archives</H1></center></b><br><br>"; $i=0; while ($i < $num1) { echo "<table width='100%' border='1' bgcolor='ffffff'>"; echo "<tr align='center' valign='middle'>"; echo "<td align='center' width='7%'><font color='red' size='4'>Event ID</font></td>"; echo "<td align='center' width='7%'><font color='red' size='4'>Date</font></td>"; echo "<td align='center' width='7%'><font color='red' size='4'>Username</font></td>"; echo "<td align='center' width='8%'><font color='red' size='4'>Department</font></td>"; echo "<td align='center' width='12%'><font color='red' size='4'>Software/Hardware</font></td>"; echo "<td align='center' width='43%'><font color='red' size='4'>Description</font></td>"; echo "<td align='center' width='8%'><font color='red' size='4'>Solved Y/N</font></td>"; echo "<td align='center' width='18%'><font color='red' size='4'>Solution ID</font></td>"; echo "</tr></table></font>"; $eventID=mysql_result($result1,$i,"eventID"); $dateStart=mysql_result($result1,$i,"dateStart"); $username=mysql_result($result1,$i,"username"); $department=mysql_result($result1,$i,"department"); $softHard=mysql_result($result1,$i,"softHard"); $eventDesc=mysql_result($result1,$i,"eventDesc"); $solved=mysql_result($result1,$i,"solved"); $solID=mysql_result($result1,$i,"solID"); echo "<table width='100%' border='1' bgcolor='ffffff' align='center'>"; echo "<tr align='center' valign='middle'>"; echo "<td valign='middle' align='center' width='7%'>$eventID</td>"; echo "<td valign='middle' align='center' width='7%'>$dateStart</td>"; echo "<td valign='middle' align='center' width='7%'>$username</td>"; echo "<td valign='middle' align='center' width='8%'>$department</td>"; echo "<td valign='middle' align='center' width='12%'>$softHard</td>"; echo "<td valign='middle' align='center' width='43%'>$eventDesc</td>"; echo "<td valign='middle' align='center' width='8%'>$solved</td>"; echo "<td valign='middle' align='center' width='18%'>$solID</td>"; echo "</tr></table>"; $ii=0; while ($ii < $num2) { echo "<br><br><table width='100%' border='1' bgcolor='ffffff'>"; echo "<tr align='center' valign='middle'>"; echo "<td align='center' width='7%'><font color='red' size='4'>Solution ID</font></td>"; echo "<td align='center' width='8%'><font color='red' size='4'>Username</font></td>"; echo "<td align='center' width='85%'><font color='red' size='4'>Solution</font></td>"; echo "</tr></table></font>"; $solID=mysql_result($result2,$ii,"solID"); $username=mysql_result($result2,$ii,"username"); $solution=mysql_result($result2,$ii,"solution"); echo "<table width='100%' border='1' bgcolor='ffffff' align='center'>"; echo "<tr align='center' valign='middle'>"; echo "<td valign='middle' align='center' width='7%'>$solID</td>"; echo "<td valign='middle' align='center' width='8%'>$username</td>"; echo "<td valign='middle' align='center' width='85%'>$solution</td>"; echo "</tr></table>"; $ii++; } $i++; } but this brings up all of the 2nd table after each of the 1st table. i know ive yet to get a reply but please guys end my torment!
  2. Hey all, I want to view data from 2 tables. both tables have various information in them. They are linked through a column named solID. both tables have equal sol ID's. My problem lies in when i want to view the tables. I dont just want to list them on table after the previous. I want to view them like this: TABLE 1 firstname lastname solID bob smith 1 TABLE 2 department sector solID accounts 2 1 TABLE 1 firstname lastname solID john walt 2 TABLE 2 department sector solID sales 4 2 etc etc so i can see the solution id one after the other any help would be appreciated. cheers
  3. My God how embarrassing. thanks a lot. careless mistake. cheers for bothering with me lol.
  4. Hey guys. Can someone tell me what is up with this query. Its driving me crazy. $updateevent="UPDATE events SET solved = 'Y' WHERE solID = '$solID'"; $result=mysql_query(updateevent) or die(mysql_error()); The table i am trying to put this in is the events table. Column solved is of TYPE VARCHAR and has a max length of 3 $solID is set to 26 There is definately a row where solID = 26 and currently the solved column reads 'N'. however when I try it.. I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'updateevent' at line 1
  5. the row is urrently set to the letter N. i want to amend or update the row so it now states the letter Y. but i think my syntax is wrong
  6. Im unsure why it finds one row in values but it wont find all three as your third userID is different from the third one in your query. why not try doing seperate queries for each value in your Values table
  7. Would it not be possible to create a sequence? then index them with that while they are being inserted? e.g. CREATE SEQUENCE index START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE; then when your inserting just use INSERT INTO tablename VALUES (index.NEXTVAL, etc etc
  8. if i want to amend a row in a table by inserting a letter can it be done? e.g. $sql="UPDATE table SET letter ='Y' WHERE ID= '1'"; ^ do i need special syntax here ^
  9. Hey all, Using php and mysql is there a way to copy a full row of a table into another table which is identical to the first one? e.g. could this table: Table1 Table2 ITEM PRICE ITEM PRICE Coffe 1.50 --------------> empty empty Donut 2.00 empty empty is this possible?
  10. sorry to ask but i dont understand. what code do you want. my ACTUAL table is quite large with a few bits of data. i am unsure of what code it is you require
  11. Hey all. im having a small difficulty with this question. say im trying to get a specific ID from a table...lets call it tablename ID NAME 1 GEOFF 2 ANDY 3 BOB so to try and get the specific ID for BOB the mysql would be: $sql="SELECT ID FROM tablename WHERE NAME='bob'"; $result=mysql_query(sql); My question is this: HOW do i then save this ID i have selected into a PHP variable? i.e. i want to save it as a variable named $bobID and so when i write... echo "$bobID"; it reads 3
  12. It is already inside a table but it is a specific row of that table that the user selects from a list. what im trying to get is a record form a table. from a user stated ID. the table name is events and i need to retrieve the specific eventID that the user requests on a form submitted a few pages ago. i stated that session variables would not work. however i only know one way of doing them.
  13. Right ok sorry for being too vague didnt mean to annoy. in another html page i am using the afore mentioned form and input box to send that variable to a specific page. however this will only send that variable to that specific page. i wish to access that variable now on a completly different page for use with php validation. I cannot use session varibles and this way of doing it..... <form name='blah' method='post' action='page.php'> <input name='blah' type='blah' value='blah'></form> will only send it to page.php I need the variable on page2.php and so i am assuming a fucntion would be needed. thanks for the input guys sorry for inconvienience
×
×
  • 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.