[Solved] I can’t find my PHP issue [closed]

This could be a browser problem. It could be a code problem. It could be a server problem. Have you tried using something like Firebug to watch what happens when you yourself take the test? Have you also tried using Firebug Lite – Firebug plugins available for other browsers, which include some-but-not-all Firebug functionality? In … Read more

[Solved] Mysql real escape [closed]

The problem is that you aren’t using it… Make this change. <?php $address = mysql_real_escape_string($_POST[‘bitcoinaddress’]); $btc = mysql_real_escape_string($_POST[‘btcamount’]); $phone = mysql_real_escape_string($_POST[‘phonenumber’]); $con = mysql_connect(“localhost”,”db user”,”password”); if (!$con) { die(‘Could not connect: ‘ . mysql_error()); } mysql_select_db(“db_name”, $con); $sql=”INSERT INTO `db_name`.`form` (`bitcoinaddress`, `btcamount`, `phonenumber`) VALUES (‘”.$address.”‘,'”.$btc.”‘,'”.$phone.”‘)”; if (!mysql_query($sql,$con)) { die(‘Error: ‘ . mysql_error()); } echo ($btc); … Read more

[Solved] Which Insert query run faster and accurate?

TL;TR The second query will be faster. Why? Read below… Basically, a query is executed in various steps: Connecting: Both versions of your code have to do this Sending query to server: Applies to both versions, only the second version sends only one query Parsing query: Same as above, both versions need the queries to … Read more

[Solved] How Secure Is This Login System? (Using Cookies In PHP)

Here’s a non-exhaustive list of problems/solutions: Your code is difficult to read because it is not properly indented. You should use prepared statemens to guard against SQL-injection. You give hints to hackers by having different error messages. When the username is correct and the password wrong you say: “Login/Password Incorrect :(“, but if the username … Read more

[Solved] php mysql show row data to columns [closed]

Converting rows to columns is called pivot. Most common way to do this is using GROUP BY and functions like MAX or SUM. Create/insert queries CREATE TABLE t (`date` DATE, `bank` VARCHAR(4), `total` INT) ; INSERT INTO t (`date`, `bank`, `total`) VALUES (‘2017-02-01’, ‘BCA’, 2500000), (‘2017-02-01’, ‘CIMB’, 1500000), (‘2017-02-01’, ‘UOB’, 3750000), (‘2017-02-02’, ‘BCA’, 2100000), (‘2017-02-02’, … Read more

[Solved] MYSQL Database connection to other website

There are certain free database hosting provider which provides remote access to their database. Remote access here signifies all the requests made to the database are originated from their own hosting server (eg, using their hosting service for php, jsp etc) or any other hosting service provider. But if remote access is not allowed means … Read more

[Solved] PHP code always shows wrong result

$result will never be null. You need to check for something like number of rows – $row_cnt = mysqli_num_rows($result); If that is greater than 0, then go to your else. 9 solved PHP code always shows wrong result

[Solved] How can i modify this sql for execute?

one update wallet SET coin=coin-(least(coin,500)) where userId=101; or the other maybe update wallet SET coin=case when coin < 500 then 0 else coin-500 end where userId=101; solved How can i modify this sql for execute?

[Solved] how to only select unique items from the database [duplicate]

You need Distinct $result = mysqli_query($db,”select DISTINCT names from uploadedproduct”); Distinct optimization allows to select only unique rows. The above query selects distinctively but case insensitive. For it be case sensitive, you could use BINARY opeartor: $result = mysqli_query($db,”select DISTINCT (BINARY names) from uploadedproduct”); 1 solved how to only select unique items from the database … Read more

[Solved] Creating a database to query

well, as stated in the comments, your question is very unspecific, but i – as a fan of php and mysql – would say that those are ONE good answer to create a website like that. you can get free software suites to help you with this endeavour, start experimenting on your home computer, learn … Read more