[Solved] Syntacts error in mysql query

The error you are receiving as you’ve shown it is because this line is incorrect: SELECT * FROM `connections` WHERE 1″ First because it’s ending in an unnecessary double quotation mark. MySQL does not use double quotes but single quotes, and even still the other single quote is not there to match it. The single … Read more

[Solved] Mysql insert into string value [duplicate]

If you’re using the deprecated mysql function: $user = “121”; $pass = “dummy1”; $email = “[email protected]”; mysql_query(“INSERT INTO users(username, password, email) VALUES(‘$user’, ‘$pass’, ‘$email’)”); On the other hand, using mysqli: mysqli_query($con, “INSERT INTO users (username, password, email) VALUES (‘$user’, ‘$pass’, ‘$email’)”); Note: where $con is the mysqli connection made variable. 3 solved Mysql insert into … Read more

[Solved] Limit MySQL Results to X Days [duplicate]

Sure. Create a time window and you can limit by that date $time = time() – (86400 * 30); // 86400 seconds in one day $sql=”SELECT * FROM table WHERE datefield > “” . date(‘Y-m-d H:i:s’, $time) . ‘”‘; That should yield you records within the last 30 days 2 solved Limit MySQL Results to … Read more

[Solved] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [closed]

Replace insert_into with insert into And better use the YYYY-MM-DD date format insert into tb_loan (Product_Code, Customer_Code, Loan_Amount, Rate_Interest, Amount_Tenure, Emi_Amount, Emi_Start, Emi_End) VALUES (0,0,’10000′,10.37,’20’,’546.6′,’2013-10-25′,’2013-10-25′) 3 solved You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [closed]

[Solved] There are 3 tables users,winks and favourite [closed]

Without LEFT JOIN See demo SQL Fiddle SELECT u.id, (SELECT w.wink_flag FROM winks w WHERE w.to_id = u.id GROUP BY w.to_id) AS WINK_FLAG, (SELECT f.fav_flag FROM favourite f WHERE f.to_id = u.id GROUP BY f.to_id) AS FAV_FLAG FROM users u WHERE u.id != 56 0 solved There are 3 tables users,winks and favourite [closed]

[Solved] I am trying to fetch data between date

I think it will be helpful for you. get the result from MYSQL table between two dates in php. try this code: <?php $con=mysqli_connect(“localhost”,”root”,””,”database_name”); $first_date=$_POST[“first_date”]; $second_date=$_POST[“second_date”]; $sql=mysqli_query($con,”SELECT * FROM `table_name` WHERE `date` BETWEEN ‘”.$first_date.”‘ AND ‘”.$second_date.”‘ “); ?> solved I am trying to fetch data between date

[Solved] How to insert images into a database using PHP [closed]

Generally the best way to do this, is to upload the file to your server, and then store the path to it in the database. File Upload: http://php.net/manual/en/features.file-upload.php You need to choose a database, MySQL is a common and free option: https://www.mysql.com/ As mentioned in comment below, (I haven’t used it before but had a … Read more

[Solved] Understanding SQL in depth [closed]

https://www.codeschool.com/search?utf8=%E2%9C%93&loc=hero&query=sql Code school is a really good introduction to most concepts regarding SQL, but it is only really possible to have a really good understanding if you truly start with the basics so I would suggest starting here and then spending quite a few hours just messing around with an sql database of your own. … Read more

[Solved] how to give specification for button in php when it is in while loop [closed]

Currently you are using one big <form> element for all your entries. When sending that form, the actual values get overridden many times and you just see the last one. To solve this, you could, e.g., make a form out of every entry like this: echo “<html>”; $c = mysql_connect(“localhost”, “root”, “”); mysql_select_db(“test”, $c); $query … Read more