Jump to content

Database interface


cfgcjm

Recommended Posts

I am looking to have one of the following setups:

 

1.jpg

 

2.jpg

 

The values in the combo box on the left and the yes/no in either object on the left are stored in the database they are being read from.

What i want to happen is if a user were to change the combo box on the left the object on the right would update to reflect it's value in the database. I have no clue how to get the object on the right to change based on the data in the database and the changing of the combo box with the names...I was told it's javascript so i was hoping someone here could help

 

Link to comment
Share on other sites

I'm already using php, i just dont know where to go from here:

<?php
$session = mysql_connect("localhost", "digiconm_admin", "33gaylan1");
mysql_select_db("digiconm_homeplate");
$query = "select * from users";

$result = mysql_query($query);
if ( !$result )
{
echo ( "<P>Error doing a select: " . mysql_error() . "</P>" );
}
else
{
// succesful read - how many records ?
print (" Number of rows read " . mysql_num_rows($result)."</br>");

$rr=mysql_num_rows($result); //this is calculating the number of rows read from database and puts it into variable rr

// loop over rows, counts the total number and prints them
$user = array(); // define array students
for ($i=0; $i<$rr; $i++) {
    $nextresult = mysql_fetch_array($result);
$fname = $nextresult['first_name'];
$lname = $nextresult['last_name'];
$journal = $nextresult['client'];
$username="$lname, $fname";
$user[$i] = $username;
$client[$i]=$journal;
echo"$user[$i] - $client[$i]\n";
} 
}
mysql_close($session);
sort($user);
?>
<html>
<head>
</head>
<body>
<form name="form" method="post" action="">
<select name="name" id="name">
<?php
foreach ( $user as $user_name ) {
echo "<option>{$user_name}</option>";
}
?>

<option selected "$user_input"></option>
</select>
<fieldset name="Group">
<legend></legend>
Yes<input name="Yes" type="radio" id="yes" checked="checked" value="1">
No<input name="Yes" type="radio"id="yes">
</fieldset>

<input name="change" type="button" value="Change"></form> 
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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