Jump to content

burnside

Members
  • Posts

    541
  • Joined

  • Last visited

Posts posted by burnside

  1. Thank you TLG,

     

    Just a slight problem though if there in no radio boc CHECKED you get the broken image image, i have tried to set one of the radio boxed to CHECKED in hope it would load the checked image but no such luck, Any ideas?

     

    Thank you again.

  2. 
    if($_GET['mod'] == "view" )
    {	
    
    		if (!mysql_select_db("blog")) {
       			echo "Unable to select mydbname: " . mysql_error();
        			exit;
    		}
    
    		$sql = "SELECT * FROM `accounts` WHERE `access` = 1 ";
    		$result = mysql_query($sql);
    
    		if (!$result) {
        			echo "Could not successfully run query ($sql) from DB: " . mysql_error();
        			exit;
    		}
    
    		if (mysql_num_rows($result) == 0) {
        			echo "<h1>Sorry there is no accounts to see. </h1><br />";
    		}
    
    		$record = mysql_num_rows($result);
    
    		echo " <h1>There is a total of <strong>{$record}</strong> accounts you may see.</h1>";
    
    
    
    		echo " <table> 
    			<tr><td width=\"25%\">Account ID </td> <td width=\"25%\"> Account Name </td> </tr> ";
    		       
    
    
    		while ($a = mysql_fetch_assoc($result)) {
        			
    		echo " <tr><td width=\"25%\">{$a['id']} </td> <td width=\"25%\"> {$a['name']}  </td></tr>";
    
    		}
    
    
    		echo " </table> ";
    
    }	
    

  3. Create a variable with "on" and "off" states. Then just toggle it for each row and use that var to determine which color to use.

     

    that means ill have to add a new record the the database though.

  4. Howdy!!

     

    I can't really decide if this is a PHP Problem or HTML ??? ???

     

    So i just posted it in here.

     

    I have a mysql array that returns results from a data base.

     

    I want to put thm in a table i can do this bit.

     

    But how would i get the table <td> colors to show two (2) diffrent colors?

     

    Like the replies on here. They go White then Blue then White etc ... ...

     

    Any way sorry if its in wrong bored :P:)

  5. Same problem... the documents are not ordered as the value in the "IN" clause...

     

    Thore told you you can't do it:

     

    There isn't a way (that I'm aware of) to order by the order of your WHERE clause.

     

    On a side note, your query could be made simpler.

     

    SELECT no_document,titre_document FROM document WHERE no_document IN(3,1,2);

     

    Looks like you may need to re think it or do three sperate querys.

  6. sorted this line is wrong

     

    echo "Article:<br /><textarea cols=\"50\" rows=\"10\" name=\"article\" value=\"{$row['article']}\" onkeyup=\"textLimit(this, 500)\"</textarea><br />";

     

    it should be

     

    echo "Article:<br /><textarea cols=\"50\" rows=\"10\" name=\"article\" onkeyup=\"textLimit(this, 500)\">{$row['article']}</textarea><br />";

     

    so it is :P

  7. try:

     

    
    $sql = ("SELECT * FROM $table WHERE id = $id");
    $result = mysql_query($sql);
    
    $row = mysql_fetch_array($result) or die(mysql_error());
    echo "<form action=\"insert.php\" method=\"post\">";
    echo "Date: <input type=\"text\" name=\"date\" value=\"{$row['date']}\" /><br /><br>";
    echo "Title:  <input type=\"text\" name=\"title\" value=\"{$row['title']}\" /><br /><br />";
    echo "Article:<br /><textarea cols=\"50\" rows=\"10\" name=\"article\" value=\"{$row['article']}\" onkeyup=\"textLimit(this, 500)\"</textarea><br />";
    echo "<input type=\"submit\" />";
    echo "</form>";
    
    

×
×
  • 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.