[Solved] PHP Global Variable in SQL [closed]

You have to update the 2nd line of the function PullOver to: $Valforthis = “select “.$GLOBALS[‘Whatis’].” from graph where month=”$Monthselect” and year=”$dateY””; 1 solved PHP Global Variable in SQL [closed]

[Solved] Cannot find sql syntax error [closed]

You have a comma too much at the end here: $sqlPrescriptionQuery .= “concat(tas.vch_first_name, ‘ ‘, tas.vch_last_name) as vch_resource_name, “; It should be: $sqlPrescriptionQuery .= “concat(tas.vch_first_name, ‘ ‘, tas.vch_last_name) as vch_resource_name “; solved Cannot find sql syntax error [closed]

[Solved] MYSQL query for selection and Grouping

If I understand correctly, you basically need SUM() of all the Get_val values where either ID_One or ID_Two is 44. Afterwards, you want to display all the unique combinations of ID_One and ID_Two with the “overall sum”. We can get the “overall sum” in a Derived Table; and then CROSS JOIN it back to the … Read more

[Solved] How Can I compare two tables?

If I understood you correctly, you want something like this. “SELECT msdnd_oct.id as id1, msakl_oct.id as id2, msdnd_oct.sold as sold1, msakl_oct.sold as sold2, msdnd_oct.sales as sales1, msakl_oct.sales as sales2 FROM msdnd_oct inner join msakl_oct ON msakl_oct.id=msdnd_oct.id” If you want to compare total sales, or sold items you can use GROUP BY Or If you simply … Read more

[Solved] How can I use bcrypted password in a query?

You don’t. Look up the user by some identifier (like a username or email address) and then check if the password field matches with password_verify. You specifically can’t lookup a user by salted password hash, that would defeat the point of salting. 1 solved How can I use bcrypted password in a query?

[Solved] mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user ‘uname’@’localhost’ (using password: YES) in /all_pts.php on line 16 [duplicate]

mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user ‘uname’@’localhost’ (using password: YES) in /all_pts.php on line 16 [duplicate] solved mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user ‘uname’@’localhost’ (using password: YES) in /all_pts.php on line 16 [duplicate]

[Solved] how checking multiple field using ajax & mysql

Write a function and trigger it on blur of your email field. Pass your email as a parameter of your function and check it into your database. This is your email field: <input type=”text” class=”form-control” name=”email” id=”email” value=”” /> This is your JavaScript code: $(document).ready(function() { $(“#email”).blur(function(){ var email = $(“#email”).val(); if(email != “”){ $.ajax({ … Read more

[Solved] Mysql combine link with title

You did not close tags correctly. Try this, they will be in same column <td><a href=”https://stackoverflow.com/questions/42284211/<?php echo $row[“description’]; ?>”> <?php echo $row[‘post_title’]; ?></a></td> I hope this helps Edit: Also for not underlined link you can use this css attribute: <td><a style=”text-decoration: none;” href=”https://stackoverflow.com/questions/42284211/<?php echo $row[“description’]; ?>”> <?php echo $row[‘post_title’]; ?></a></td> 0 solved Mysql combine link … Read more

[Solved] Avoid data redundancy in a friends table

Add field friendship_key: ALTER TABLE t_friend ADD friendship_key decimal(22,11); CREATE UNIQUE INDEX friendship_key_unique ON t_friend (friendship_key); And php part: $friends = [$userId, $friendId]; $key = min($friends).’.’.max($friends); $q = “SELECT * FROM t_friend WHERE friendship_key = “.$key; insert: $friends = [$userId, $friendId]; $key = min($friends).’.’.max($friends); $q = “INSERT INTO t_friend (friendship_key, userId, friendId) VALUES (“.implode(‘,’, [$key, … Read more

[Solved] Can someone explain this SQL for me?

You have a table called reports and you are extracting a table that consists of the id, user, item_id, and created fields. This new table will only have rows that contain the max value of created for each distinct item_id. This part extracts the fields you want: select a.id, a.user, a.item_id, a.created From a table … Read more

[Solved] get the follow posts based on date [closed]

I’m not really sure if your tables are in sql, but in case they are, I think the best way to get the data as you want is with a LEFT JOIN as follows: SELECT * FROM follow JOIN posts ON (follow.friends = posts.uid OR follow.uid = posts.uid) WHERE follow.uid = {user_uid} Where {user_id} is … Read more

[Solved] Delete all rows except the one with the biggest value

DELETE FROM `transactions` WHERE id NOT IN ( SELECT MAX(id) FROM `transactions` group by user_id ) The inner query groups by each user and select only the highest ID for each. Delete all records except the IDs from the inner select. 0 solved Delete all rows except the one with the biggest value