eburlea 23 Junior Poster

PHP is executed on the server.
Javascript is executed on the client side (in the browser).
If you want to create real dynamic pages, I think you should learn Javascript as well. Also jQuery (Javascript library) and AJAX.

eburlea 23 Junior Poster
eburlea 23 Junior Poster

Try instead:

$something  = mysql_fetch_array($count);
while ($something = mysql_fetch_array($count)){

write:

while ($something = mysql_fetch_array($result)){
eburlea 23 Junior Poster

Does it help you?

<select name="table-type" id="select-t">
    <option value="" disabled selected>Types of Tables</option>
    <option value="seat-r">Round Table</option>
    <option value="seat-b">Banquet Table</option>
    <option value="seat-s">Square Table</option>
</select><br>
No. of seats : <br>
<input type="text" readonly placeholder="Select Table" size="8" id="inform" />
<select name="seatno" class="seat" id="seat-r" style="display: none;">
    <option value="" selected disabled>No. of seats</option>
    <option value="6">6</option>
    <option value="8">8</option>
    <option value="10">10</option>
    <option value="12">12</option>
</select>
<select name="seatno" class="seat" id="seat-b" style="display: none;">
    <option value="" disabled selected>No. of seats</option>
    <option value="6">6</option>
    <option value="8"></option>
    <option value="10"></option>
</select>
<select name="seatno" class="seat" id="seat-s" style="display: none;">
    <option value="" disabled selected></option>
    <option value="6">6</option>
    <option value="8">8</option>
</select>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('#select-t').unbind().bind('change',function(){
        var elemId = $(this).val();
        showElement(elemId);
        $("#inform").hide();
    });
    function showElement(id){
        $('.seat').each(function(){
            if($(this).attr('id') == id){
                $(this).show();
            } else {
                $(this).hide();
            }
        });
    }
});
</script>
eburlea 23 Junior Poster

This should work:

<?php
$i = 0;
while($row = mysql_fetch_assoc($query)){
    $dataLevel[$i]['q_id'] = $row['q_id'];
    $dataLevel[$i]['response_value'] = $row['response_value'];
    $dataLevel[$i]['cr_chpt'] = $row['cr_chpt'];
    $dataLevel[$i]['ql_level'] = $row['ql_level'];
    $i++;
} 
?>
<script type="text/javascript">
var dataLevel = JSON.parse('<?php echo json_encode($dataLevel); ?>');
for(var i=0; i<dataLevel.length; i++){
    document.write(dataLevel[i]['q_id'] + '<br />');
    document.write(dataLevel[i]['response_value'] + '<br />');
    document.write(dataLevel[i]['cr_chpt'] + '<br />');
    document.write(dataLevel[i]['ql_level'] + '<br /><br />');
}
</script>
eburlea 23 Junior Poster

Can this help you?

<?php
$dataLevel = [[280, "ANALYZE", 260, 560],
              [230, "APPLY", 260, 510],
              [180, "UNDERSTAND", 260, 460],
              [130, "REMEMBER", 260, 410]];
?>
<script type="text/javascript">
var dataLevel = JSON.parse('<?php echo json_encode($dataLevel); ?>');
for(var i=0; i<dataLevel.length; i++){
    document.write(dataLevel[i] + '<br />');
}
</script>
eburlea 23 Junior Poster
jQuery('.date-pick').removeClass('hasDatepicker').datepicker({
    dateFormat: 'mm-dd-yy'
    });
eburlea 23 Junior Poster

Is the server on Linux? I tested the code on the server that runs on Linux and I had the same problem and after runing in Terminal 'chmod 777 -R mytestsite' it worked fine. I just gave all privileges to the folder that contains the php script file and the image.

eburlea 23 Junior Poster

Check the picture properties, it may be read-only.

Then you may change the code to:

    $old = "./images/general/item2.jpg";
    $new = "./images/general/item44.jpg";
    if(file_exists($old))
    {
        rename($old, $new) or die('Error renaming file.');
        echo "The file has been renamed successfully.";
    }
    else
    {
        echo 'The file does not exist.';
    }
eburlea 23 Junior Poster

You can use jQuery User Interface Dialog: http://jqueryui.com/dialog/#modal-form