Jump to content

paulman888888

Members
  • Posts

    332
  • Joined

  • Last visited

    Never

Everything posted by paulman888888

  1. i cant do it onmouseover please can someone make an example please.
  2. ok so how can i do it it javascript thankyou
  3. When the mouse goes over the tablerow how do i change the background colour useing css. i got this so far .tabletype1{ background:#00FF00; } Thankyou for all the help
  4. it comes up with this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/civage.com/downloads.php on line 13 and i dont know what is wrong Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/csomewhere.co.uk/theerror.php on line 13 PLease help me find the problem
  5. found it its that echo "<td><a href='".$row['location']."'><img src="images/downloadsm.png" /></a></td>\n";
  6. i cant use that because its coming out of a mysql database.
  7. I have got my php code but i dont know how to put a link with an image my code echo "<td>".$row['location']."</td>\n"; how can i have an image that has a link to location? i thought of this but i think its wrong echo "<td><a href='".$row['location"]."'><img src="images/downloadsm.png" /></a></td>\n"; Please help
  8. and to do class i would do this $i = 0; // setup a counter while($row = mysql_fetch_array( $result )) { // alternate colors $class = ($i%2 == 0) ? 'tabletype1' : 'tabletype2'; // Print out the contents of each row into a table echo "<tr style=\"class: $class;\">\n"; echo "<td><a href='delete.php?id=".$row['id']."'>".$row['id']."</a></td>\n"; echo "<td>".$row['name']."</td>\n"; echo "<td>".$row['score']."</td>\n"; echo "<td>".$row['ipaddress']."</td>\n"; echo "<td>".$row['date']."</td>\n"; echo "</tr>\n"; $i++; // increment counter } echo "</table>"; is that right?
  9. I have my php and mysql set up but i want it to be a pretty table. So i would like it to be more like this <table width="100%" border="1"> <tr bgcolor="#33FF00"> <td> </td> <td> </td> </tr> <tr bgcolor="#0000FF"> <td> </td> <td> </td> </tr> </table> Where the rows change colour from green to blue. How would i get my php code to do that? <?php // Get all the data from the "example" table $result = mysql_query("SELECT * FROM example ORDER BY score DESC") or die('O no. Theres an error'); echo "<table border='1'>"; echo "<tr><th>ID</th><th>Name</th><th>Score</th><th>Ip address</th><th>Date</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr>\n"; echo "<td><a href='delete.php?id=".$row['id']."'>".$row['id']."</a></td>\n"; echo "<td>".$row['name']."</td>\n"; echo "<td>".$row['score']."</td>\n"; echo "<td>".$row['ipaddress']."</td>\n"; echo "<td>".$row['date']."</td>\n"; echo "</tr>\n"; } echo "</table>"; ?> At the moment all the table backgrounds are the same. thankyou
  10. This is the code for my view scores <?php // Get sort method $sort = isset($_GET['order']) ? mysql_real_escape_string($_GET['order']) : 'score'; // Get all the data from the "myscore2" table $result = mysql_query("SELECT * FROM myscore2 ORDER BY `{$sort}` DESC"); //the rest is not important How could i add a AESC or DESC link
  11. i have my php script but i would like to order my list relervent to the $_get['order'] (or if there isnt anything in $_get['order'] show all in order with highest score 1st) but i dont know how to input this into my script. eg something.php?order=ipaddress i would like it to be ordered by ipaddress. <?php // Get all the data from the "myscore2" table $result = mysql_query("SELECT * FROM myscore2 ORDER BY score DESC"); echo "<table border='1'>"; echo "<tr><th>ID</th><th>Name</th><th>Score</th><th>Ipaddress</th><th>Game id</th><th>The Date</th><th>Mode</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr>\n"; echo "<td><a href='delete.php?id=".$row['id']."'>".$row['id']."</a></td>\n"; echo "<td>".$row['name']."</td>\n"; echo "<td>".$row['score']."</td>\n"; echo "<td>".$row['ipaddress']."</td>\n"; echo "<td>".$row['gameid']."</td>\n"; echo "<td>".$row['thedate']."</td>\n"; echo "<td>".$row['mode']."</td>\n"; echo "</tr>\n"; } echo "</table>"; ?> Thankyou
  12. Does anyone know some good software for Mysql. (not Mysql itself). Thanks
  13. If i use this gameid=$_GET['gameid'] and theres no gameid=something in the url what would be the value of it because i would like to make an IF statment. If gameid=$_GET['gameid'] doesnt exist then $gameid=0 else gameid=$_GET['gameid'] How could i make that. thankyou for all the help
  14. first of all start reading the PHP manual. GOOGLE it and read it all. It should help but any more errors come back here
  15. Is there a way to echo out all the data in a mysql table? Thankyou
  16. I have made my code but i get an error. Below is my code. <?php $ip = $_SERVER['REMOTE_ADDR']; $today = date("m.d.y"); $time = time("H"); // Insert a row of information into the table "myscore2" mysql_query("INSERT INTO myscore2 (name, score, gameid, mode, thedate, thetime, ) VALUES('" . mysql_real_escape_string(substr($_GET['name'], 0, 13)) . "', '" . mysql_real_escape_string($_GET['score']) . "', '" . mysql_real_escape_string($_GET['gameid']) . "', '" . mysql_real_escape_string($_GET['mode']) . "', '" . mysql_real_escape_string('{$today}') . "', '" . mysql_real_escape_string('{$time}') . "', '" . mysql_real_escape_string('{$ip}') . "', )") or die(mysql_error()); echo "Score Uploaded!#"; ?> and 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 ') VALUES('testing1111', '9999', '444', '1', '{$today}', '{$time} What am i doing wrong? Thankyou
  17. how do i get the time? 00:00:00 hours:mins:secs thankyou
  18. no no no no no. For each answer is a row. Instead of seeing who click what. Try this. if i clicked on option 2 you should get it to do the following option2 = add 1 to the current value (you should now how to get the current value) dont do person 1 = option1 person 2 = option3 because it takes loads of time.
  19. make an form first i am calling mine add.php my form is useing get and the action is add1.php and the form feild is called add. Now add a submit button. below is add1.php <?php //make an connection mysql_query("INSERT INTO TABLENAME //change this (change this to the table you want to put it in,) VALUES('" . mysql_real_escape_string(substr($_GET['add'], 0, 50)) . "',)") //change add to the form name or die('Theres an error.# Please try again.#'); echo "Completed with no errors"; ?> now upload to them to your server, load up add.php and type in the name of the thing you want to add then click submit. If it works you should see Completed with no errors.
  20. I have my code but i want to show only results with the same gameid and $_get['gameid'] heree is my code that i think i need to edit but dont know how. $result = mysql_query("SELECT * FROM myscore2 ORDER BY score DESC") Thankyou
×
×
  • 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.