[Solved] In select box option I want to search all the columns from mysql instead of one showing in dropdown option in php

[ad_1] I give here example for the data-attribute. You have to add your logic for searching the phone, it is a basic idea for select the option from the search match. PHP code: <select id=”selectuser”> <?php foreach($db->selectboxoption($sql_fuel_type) as $data){ echo ‘<option data-phone=”‘.$data[“phone_no”].'” value=”‘.$data[“type_category_id”].'”>’.$data[“type_category_name”] .'</option>’; } ?> </select> Jquery code: // your logic here(if phone no … Read more

[Solved] How do I loop a nested array in laravel to get an array based on conditions of key values from that array

[ad_1] Suppose if your $request->option contain array then $filtered = collect($request->option)->whereNotNull(‘option’)->all()->toArray(); Ref: https://laravel.com/docs/8.x/collections#method-wherenotnull [ad_2] solved How do I loop a nested array in laravel to get an array based on conditions of key values from that array

[Solved] This update query won’t update record

[ad_1] <?php if (isset($_GET[‘edit’])) { ?> <form action=”index.php” method=”post”> <input type=”text” name=”id” value=”<?=$id;?>”> <input type=”text” name=”nieuweprijs” placeholder=”vul nieuwe prijs in”> <input type=”submit” name=”submitnieuweprijs” value=”verzenden”><form> <?php } if (isset($_POST[‘submitnieuweprijs’])) { $nieuweprijs = Safesql($_POST[‘nieuweprijs’]); $id = Safesql($_GET[‘id’]); if(!$mysqli->query(“UPDATE prijzen SET prijs=””.$nieuweprijs.”” WHERE id='”.$id.”‘”)) { echo $mysqli->error;} Laden(0); } } ?> $id is the value obtained from the … Read more

[Solved] laravel Auth session expire do some action in to database

[ad_1] If you don’t want control it after a request (which can be done with middlewares) you should use the Database Session Driver. Change it in config/session to ‘driver’ => ‘database’. Then create the session table with artisan: php artisan session:table composer dump-autoload php artisan migrate Now you are able to check for users status … Read more

[Solved] PHP and MySQL using xampp as web server [closed]

[ad_1] I think this takes a little more than a simple answer, try reading a php-mysql tutorial: https://www.w3schools.com/Php/php_mysql_intro.asp In plain Mysql you just need a “insert into” statement with a select, as explained here. Then you’ll just need to create a php statement to execute this SQL. [ad_2] solved PHP and MySQL using xampp as … Read more

[Solved] How to SELECT and INSERT until ordered quantity is completed using nested query in MySQL

[ad_1] I hope and imagine that there must be a more performant solution, but anyway, consider the following: Schema (MySQL v8.0) DROP TABLE IF EXISTS product_batches; CREATE TABLE product_batches (batch_number SERIAL PRIMARY KEY ,product_id INT NOT NULL ,quantity_available INT NOT NULL ); INSERT INTO product_batches VALUES ( 1,1,15), ( 3,1, 5), ( 7,1,20), (10,1,30), (11,1,50); … Read more

[Solved] Want to search like that [closed]

[ad_1] This is not a trivial problem, but conceptually you would approach it as follows. In a text input, call a function every time a user enters a value: <input class=”someClass” id=’someId’ name=”someName” type=”text” onkeyup=’getProperties(this.value)’ > Where getProperties uses ajax and might look something like this: function getProperties(value) { $.post( “somePHPFile.php”, {query: value}, function (data) … Read more

[Solved] PHP comment system and login system

[ad_1] add another column in table beside comment and update it using admin page, set either 0 for unapproved and 1 for approved value of that table , according to that column value comment get shown on post! [ad_2] solved PHP comment system and login system

[Solved] php: syntax error when changing from v7 to v5

[ad_1] You need to call login_info($email, $password) and assign to a variable separately then get the index from that new variable. The reason for this is that your version of PHP (which I guess is actually 5.3, which is old and dead so I’d recommend a better host) doesn’t support function array dereferencing (the bit … Read more

[Solved] Automatic add variables in PHP sent form [closed]

[ad_1] I am trying to explain to change little bit of coding technic. Use Following Technic in your HTML file. <form> <input type=”text” name=”data[name1]” /> </form> Use following technic at your server side. <?php $postData = $_REQUEST[‘data’]; //you only have to fetch array data so all post data will be get without their name ?> … Read more