[Solved] Strategies for large amount of db queries for single page request [closed]

There’s no real hard limit. It will all depend on a number of factors; including the profile of your db traffic, the resources available to your db, your db architecture (replicated/distributed etc), your schema, your app design, network connectivity, your user’s expectations. The best thing to do would be to have an idea of what … Read more

[Solved] Combine Multiple rows from mysql array

You need to use a other array. <?php $lender = mysql_query(“Select * from lender where reference=”$reference””); $formated_lender = array(); while ($lenderrow=mysql_fetch_array($lender)) { $formated_lender = $lenderrow[“lender”] . ” ” . $lenderrow[“lenderref”] . ” ” . “£” . $lenderrow[“amount”]; } foreach ($formated_lender as $row) { echo $row . ‘<br />’; } Or, if you would just one … Read more

[Solved] MYSQL SELECT AND COUNT MULTIPLE ROWS BY MONTH

In order to compute aggregate values you have to use GROUP BY SELECT EXTRACT(YEAR_MONTH FROM `date`) AS year_month, COUNT(*) AS cnt FROM tableName WHERE `status` = ‘sold’ GROUP BY EXTRACT(YEAR_MONTH FROM `date`) Keep in mind that, because of the function EXTRACT() used in the GROUP BY clause, MySQL cannot use an index to optimize the … Read more

[Solved] How can I get data from database into HTML table?

You need PHP for this first you have to connect PHP with your db $connection = mysqli_connect(“YourHost”,”user”,”password”,”dbName”) or die(‘connection to DB failed’); then you need a query to get the team names $query = mysqli_query($connection,”SELECT team FROM s1″); now you need a array to save the DB values $row = mysqli_fetch_array($query,MYSQLI_NUM); the connection to the … Read more

[Solved] view how many people compelete the quiz on admin panel [closed]

got it. Your PHP code to increse your counter is: <?php $servername = “localhost”; $username = “root”; $password = “”; $db_name = “route”; // Create connection $mysqli = new mysqli($servername, $username, $password, $db_name); // Check connection if ($mysqli->connect_error) { die(“Connection failed: ” . $mysqli->connect_error); } $sql = “UPDATE quizes SET count = count + 1 … Read more

[Solved] I want to access another server database in PHP

Just read errors and correct it.. <?php $server2 = ‘192.168.1.211’; $con = mysqli_connect($server2,’root’,’password’,’vvani’); // here, $server2 is variable, not constant if (mysqli_connect_errno()) { echo “Failed to connect to MySQL: ” . mysqli_connect_error(); } 2 solved I want to access another server database in PHP

[Solved] PDO in PHP doesn´t work – no error

In addition to what @Niet Suggested you have to know that you cannot reuse the same name for the placeholder like you did: INSERT INTO veranstaltung_anfrage (….) VALUES (..:a, :a, :a, :a, :a, :a, :a) You will need to give them unique names: INSERT INTO veranstaltung_anfrage (….) VALUES (..:a1, :a2, :a3, :a4, :a5….) then bind … Read more

[Solved] I am trying to create a sql table in phpmyadmin, I’m getting 4 errors. This code works in phpmyadmin on my pc at my work but not on the pc at home [closed]

I am trying to create a sql table in phpmyadmin, I’m getting 4 errors. This code works in phpmyadmin on my pc at my work but not on the pc at home [closed] solved I am trying to create a sql table in phpmyadmin, I’m getting 4 errors. This code works in phpmyadmin on my … Read more

[Solved] Print all times, except the ones in the DB [closed]

with DB query fetch the values so that you get something like $blacklist = array(’18:00′,’19:00′) check for time being black-listed with if(!in_array(’18:00′, $blacklist)){…} if you have white-listed values as array, and you don’t want to check in viewing part, then its better to use array_diff as @YaK answered solved Print all times, except the ones … Read more