Category : select

I’m concerned about performance when performing multiple subqueries (8 to be exact) in a SELECT. When tested, it took approximately 5 seconds to find a result. Given that I have a database with 3 tables: combinations, groups and subjects. group_1, group_2, group_3 and group_4 reference an id from subjects. subject_id references an id from groups. ..

Read more

I am trying to run this MySQL query from PHP app. SELECT * FROM LIVE WHERE STATUS=1 AND (CRITERIA=’demo’ OR CRITERIA=’all’ OR CRITERIA=’1′ OR CRITERIA=’1E’) Which is working perfectly. However I want that if this query returns nothing then it should execute another query somewhat like this. SELECT * FROM LIVE WHERE STATUS=0 AND (CRITERIA=’demo’ ..

Read more

How do I select the value from the drop-down if the value matches the function? Unable to select the value for example if $match value is 08:00 function should select the value from the dropdown list? PHP Function function create_time_range($start, $end, $interval = ’15 mins’, $format = ’12’) { $startTime = strtotime($start); $endTime = strtotime($end); ..

Read more

Data retrieved from MySQL and shown in select In option data retrieved is showing blank values <select name="select-car" class="form-control" id="select-car" required> <option value=”>Select Car</option> <?php global $wpdb; $servername = "localhost"; $username = "carsrental"; $password = "carsrental123x"; $dbname = "cars-rental"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection ..

Read more

// (assuming Database is connected) SELECT from ‘newsletter table $sql_query = "SELECT * FROM newsletter WHERE email = ‘[email protected]‘"; if ($result = mysqli_query($conn_clients, $sql_query)){ if (mysqli_num_rows($result) > 0) { echo "<table>"; echo "<tr>"; echo "<th>Id</th>"; echo "<th>Name</th>"; echo "<th>Email</th>"; echo "</tr>"; // output data of each row while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" ..

Read more

I have a problem with the post, I can not post the value on the same page. $result = mysqli_query($con, "SELECT * FROM bgu_characters") or die(mysqli_error($con)); $ID=$_POST[‘charactets’]; $result2 = mysqli_query($con, "SELECT * FROM bgu_characters where cid=’$ID’ ") or die(mysqli_error($con)); while($row = mysqli_fetch_array($result2)) { ?> <form id="myform" name="myform" method="post" action="<?php echo htmlspecialchars($_SERVER[‘PHP_SELF’]); ?>"> <div class="form-group"> <label ..

Read more