Jump to content

mwasif

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by mwasif

  1. Disable it using .htaccess (if you are using Apache).
  2. 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%
  3. Do you want to delete (drop) 2 tables in a single query or want to delete records from 2 tables in a single query?
  4. 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
  5. 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
  6. Try this one SELECT last_updated from tbl WHERE last_updated > DATE_SUB(NOW(), INTERVAL 2 DAY)
  7. You can create a new MySQL user with limited privileges and use that user in phpMyAdmin to give access to the user.
  8. It return the commands according to the current table structure.
  9. In MySQL replication you can update the changes from master to slave (one way). Are these databases remotely located?
  10. Use LAST_INSERT_ID() in MySQL and mysql_insert_id() if you are using PHP to insert records into MySQL.
  11. 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/
  12. mwasif

    Insert into

    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)
  13. I don't think so that you can change this option with SET GLOBAL.
  14. use echo mysql_error(); after mysql_quey() to know the error.
  15. It is better to have skip-name-resolve in MySQL configuration file when running webserver and MySQL server on separate machines.
  16. 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.
  17. I can only think of using GROUP BY the way you have explained your problem.
  18. 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.
  19. 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
  20. 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.
  21. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.