Skip to main content
se eliminaron 338 caracteres en el cuerpo
Origen Enlace

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin<</option>
          <option value="2">Lois Griffin<</option>
          <option value="3">Joseph Swanson<</option>
          <option value="4">Glenn Quagmire<value="4">Glenn</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>


<?php
$q = intval($_GET['q']);

$con = mysqli_connect('localhost','root','admin123','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Age</th>
        <th>Hometown</th>
        <th>Job</th>
        </tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['FirstName'] . "</td>";
    echo "<td>" . $row['LastName'] . "</td>";
    echo "<td>" . $row['Age'] . "</td>";
    echo "<td>" . $row['Hometown'] . "</td>";
    echo "<td>" . $row['Job'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>


<?php
$q = intval($_GET['q']);

$con = mysqli_connect('localhost','root','admin123','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Age</th>
        <th>Hometown</th>
        <th>Job</th>
        </tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['FirstName'] . "</td>";
    echo "<td>" . $row['LastName'] . "</td>";
    echo "<td>" . $row['Age'] . "</td>";
    echo "<td>" . $row['Hometown'] . "</td>";
    echo "<td>" . $row['Job'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter </option>
          <option value="2">Lois </option>
          <option value="3">Joseph </option>
          <option value="4">Glenn</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>


<?php
$q = intval($_GET['q']);

$con = mysqli_connect('localhost','root','admin123','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
        <tr>
        <th>Firstname</th>
        </tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['FirstName'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html> 


<?php
$q = intval($_GET['q']);

$con = mysqli_connect('localhost','root','admin123','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Age</th>
        <th>Hometown</th>
        <th>Job</th>
        </tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['FirstName'] . "</td>";
    echo "<td>" . $row['LastName'] . "</td>";
    echo "<td>" . $row['Age'] . "</td>";
    echo "<td>" . $row['Hometown'] . "</td>";
    echo "<td>" . $row['Job'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
Firstname Lastname Age Hometown Job "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['FirstName'] . ""; echo "" . $row['LastName'] . ""; echo "" . $row['Age'] . ""; echo "" . $row['Hometown'] . ""; echo "" . $row['Job'] . ""; echo ""; } echo ""; mysqli_close($con); ?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>
Firstname Lastname Age Hometown Job "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['FirstName'] . ""; echo "" . $row['LastName'] . ""; echo "" . $row['Age'] . ""; echo "" . $row['Hometown'] . ""; echo "" . $row['Job'] . ""; echo ""; } echo ""; mysqli_close($con); ?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html> 


<?php
$q = intval($_GET['q']);

$con = mysqli_connect('localhost','root','admin123','database');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"ajax_demo");
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysqli_query($con,$sql);

echo "<table>
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Age</th>
        <th>Hometown</th>
        <th>Job</th>
        </tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['FirstName'] . "</td>";
    echo "<td>" . $row['LastName'] . "</td>";
    echo "<td>" . $row['Age'] . "</td>";
    echo "<td>" . $row['Hometown'] . "</td>";
    echo "<td>" . $row['Job'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
se añadieron 829 caracteres en el cuerpo
Origen Enlace

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>
Firstname Lastname Age Hometown Job "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['FirstName'] . ""; echo "" . $row['LastName'] . ""; echo "" . $row['Age'] . ""; echo "" . $row['Hometown'] . ""; echo "" . $row['Job'] . ""; echo ""; } echo ""; mysqli_close($con); ?>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>

Necesito que cuando selecionen una opcion y den click en el boton guardar me guarde y mi base de datos pero no como programar la parte php.

<!DOCTYPE html>
<html>
<head>
    <title>Prueba Select</title>
</head>
<body>
    <center>
        <select name="users" onchange="showUser(this.value)">
          <option value="">Select a person:</option>
          <option value="1">Peter Griffin</option>
          <option value="2">Lois Griffin</option>
          <option value="3">Joseph Swanson</option>
          <option value="4">Glenn Quagmire</option>
         </select>
    
    <input style="border-radius: 8px" type="submit" name="Guardar" value="Guardar">

    </center>   
</body>
</html>
Firstname Lastname Age Hometown Job "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['FirstName'] . ""; echo "" . $row['LastName'] . ""; echo "" . $row['Age'] . ""; echo "" . $row['Hometown'] . ""; echo "" . $row['Job'] . ""; echo ""; } echo ""; mysqli_close($con); ?>
se añadieron 80 caracteres en el cuerpo
Origen Enlace
Shaz
  • 29.2k
  • 18
  • 40
  • 61
Loading
Origen Enlace
Loading