mwasif
Members-
Posts
130 -
Joined
-
Last visited
Everything posted by mwasif
-
Should escaped data be physically stored in MySQL
mwasif replied to bnelson333's topic in MySQL Help
Disable it using .htaccess (if you are using Apache). -
Ohh, I missed that part.
-
Try this one $query = "select * from FUNERAL where CUSTOMER = 'Y' AND POSTCODE LIKE '%$trimmed%' OR COUNTY LIKE '%$trimmed%' order by POSTCODE"; Use single quotes instead of double quotes around %$trimmed%
-
Do you want to delete (drop) 2 tables in a single query or want to delete records from 2 tables in a single query?
-
So the output can not be stored to a variable. In PHP, you should be able to run the below command using system() or exec() and provide the output file location accessible by PHP and from there you can read the file. mysql -e "SELECT ..." > file_name
-
Apply GROUP BY on t1.id SELECT t1.id as 'id',t3.name as 'Brand',t2.Name as 'Sport',t1.fname,t1.lname, t1.cardnum,t1.year1,t1.year2,t1.price,t1.qty,t4.cond as 'Cond',t1.beckett_price, t1.price_paid as 'paid', t5.landscape as landscape FROM `Cards` as t1 INNER JOIN `Sports` as t2 on t2.id=t1.sportID INNER JOIN `Brand` as t3 on t3.id=t1.brandID INNER JOIN `Con` as t4 on t4.id=t1.cond LEFT OUTER JOIN `Img` as t5 on t5.cardID=t1.id GROUP BY t1.id ORDER BY id DESC LIMIT 100
-
Try this one SELECT last_updated from tbl WHERE last_updated > DATE_SUB(NOW(), INTERVAL 2 DAY)
-
You can create a new MySQL user with limited privileges and use that user in phpMyAdmin to give access to the user.
-
Copy tables between databases automatically and regularly?
mwasif replied to seany's topic in MySQL Help
Setup a cronjob to do this task for you. -
It return the commands according to the current table structure.
-
In MySQL replication you can update the changes from master to slave (one way). Are these databases remotely located?
-
[SOLVED] Get Auto_Increment Value from New Insert
mwasif replied to FlyingIsFun1217's topic in MySQL Help
Use LAST_INSERT_ID() in MySQL and mysql_insert_id() if you are using PHP to insert records into MySQL. -
Yes. Following links will give you complete understanding of indexes. http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html http://www.sitepoint.com/article/optimizing-mysql-application/
-
This will SELECT the data from Booking table and INSERT into tbl_temp INSERT INTO `tbl_temp` ( `booking_id`, `club_id` ) SELECT booking_id, club_id FROM Booking Note: There is a difference between ' (single quote) and ` (backtick, above Tab key)
-
I don't think so that you can change this option with SET GLOBAL.
-
use echo mysql_error(); after mysql_quey() to know the error.
-
[SOLVED] Posting only one line of data where multiple results are possible
mwasif replied to spiceydog's topic in MySQL Help
You are welcome -
It is better to have skip-name-resolve in MySQL configuration file when running webserver and MySQL server on separate machines.
-
You can do all this stuff in a single database. You can a single table for all users... You should find a tutorial to design a basic database then you go further.
-
[SOLVED] Posting only one line of data where multiple results are possible
mwasif replied to spiceydog's topic in MySQL Help
I can only think of using GROUP BY the way you have explained your problem. -
What do you mean by DB reads? If you are concerned about a MySQL user, then you can set the SELECT limit on MySQL user. But if you are talking about your site access, then you can count number of hits from a sepecific IP or save a cookie on client side and count the hits with its help.
-
Getting records within the last week, starting BEFORE the current day...
mwasif replied to Jabop's topic in MySQL Help
SELECT * FROM most_viewed WHERE Date>=DATE_SUB(DATE_ADD(CURDATE(), INTERVAL -1 DAY), INTERVAL 1 WEEK) AND Date<CURDATE() ORDER BY Views DESC LIMIT 1 -
Yes, you can do that. There is no issue when you set different prefix. It is used for the very same purpose. If you can afford new database, then you should go for that just to keep the things separate.
-
You can install and run 2 different mysql versions on the same machine at the same time without any problem. You just have to install new mysql on a port different than 3306. Most likely your existing mysql will be running on 3306.
-
Try using SOUNDEX().