php - getting the row on mysql -
addinfo = new addinfo(); int c; c = a.getrw(); string sql = "select row(*) * coproproject.table (user_id, user_lastname, user_firstname, user_mi, user_gender, user_age, bday_month, bday_date, bday_year, user_address, user_status, user_nationality, user_contact, user_email) value (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "; i want c (number of row in database (coproproject.table))
i want string value of fields database appear in text field
how ?
i think, you're confusing select , insert. well, here's think looking for. select using mysqli:
$yourconnection=mysqli_connect("yourhost","yourusername","yourpassword","yourdatabase"); if(mysqli_connect_errno()){ echo "error".mysqli_connect_error(); } $result = ($yourconnection, "select * coproproject"); while($row=mysqli_fetch_array($result)){ $id=$row['user_id']; echo "<input type='text' name='userid' value='$id'>"; /* put text field user_id */ echo " ".$row['user_lastname']." ".$row['user_firstname']." ".$row['user_mi']." ".$row['user_gender']." ".$row['user_age']." ".$row['bday_month']." ".$row['bday_date']." ".$row['bday_year']." ".$row['user_address']." ".$row['user_status']." ".$row['user_nationality']." ".$row['user_contact']." ".$row['user_email']."<br>"; } $numofrows=mysqli_num_rows($result); /* number of fetched rows */ echo $numofrows; ?>
Comments
Post a Comment