i have some problem. My mysql is throwing some error :
Could not execute query.Commands out of sync; you can't run this command now
I have learn that the syntax itself perhaps conflict with the other function.
My case is, i have a page that getting result from database. And using while statement, it shows in the text box. Now, i want to update the values in the same page. Because some values are not text input, so it's not easy to get the values. I place another php function() inside the while() function.
here's the syntax:
while statement for rendering the textbox
include '../functions/configuration.php';
$query = "call sp_callViewTransc($ids)";
$result = mysql_query($query) or die("Could not execute query. " . mysql_error());
**while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {**
**<!-- WHILE FUNCTION IS GETTING RESULT FROM DB -->**
?>
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">General Information</a></li>
<li><a href="#tab2" data-toggle="tab">Computer Information</a></li>
<li><a href="#tab3" data-toggle="tab">OS and Licenses</a></li>
<li><a href="#tab4" data-toggle="tab">Remarks</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<form class="form-horizontal">
<p>Asset General Information. Some order goes here.</p>
<fieldset>
<!-- Text input-->
<div class="control-group">
<label class="control-label">Location</label>
<div class="controls">
<input id="idms_location" name="idms_location" type="text" placeholder="location" class="input-xlarge" readonly="readonly" value="<?php echo $row['idms_location']; ?>">
<?php getLocation(); ?>
**<!-- getLocation() function is another function in another file that getting dropdown values-->**
</div>
</div>
Is there any php function to solve this code?
** update **
here's my second function in php that getting results for combobox
function getLocation() {
$query_location = "SELECT location, idms_location FROM ms_location";
$location_list = mysql_query($query_location) or die("Could not execute query." . mysql_error());
echo "<select>";
while ($row = mysql_fetch_array($location_list, MYSQL_ASSOC)) {
echo("<option value='" . $row['idms_location'] . "'>" . $row['location'] . " </option>");
}
echo "</select>";
mysql_close();
}