MySQL

July 30, 2012February 13, 2013 on MySQL tagged mysql append, mysql append character

MySQL query to append character to each entry

Scenario: You want to append a string or character at the beginning of a db field. solution: UPDATE Tablename SET Username = Concat(‘0’, Username);

July 30, 2012February 13, 2013 on MySQL tagged mysql add, mysql field add number, mysql update

Add an integer with a field value

Scenario: You have a field in database where you want to add it all with a number for example: 1000; you can update all of them like this: UPDATE mysql_table SET user_id = 1000 + user_id;

December 26, 2011December 26, 2011 on MySQL tagged mysql hour, mysql time

How to get data which is added between hours in MySQL?

SELECT * FROM TABLE WHERE HOUR(time) BETWEEN 1 AND 2; This query brings all records between 1 and 2 o’clock according to time field of you table. (time = The DB field which you save the time)

June 4, 2011June 4, 2011 on MySQL tagged check record, check record in database

Check if a record exist in a specific table of database in MySQL

You can check if a record exist in a specific table of database in MySQL with the code block below: if(mysql_num_rows(mysql_query(“SELECT * FROM reports WHERE reportID = ‘$reportNUM'”))){ // Code inside if block if reportID is already there }

March 24, 2010December 14, 2010 on MySQL, Programming General tagged mysql rastgele veri, mysql veri, mysqlden rastgele

Mysql veritabanında Rastgele veri çekmek

Bunun için; çekeceğiniz query’nin sonunda  şunlar ekliyorsunuz:(Kalın olarak yazılan kismi)  $sorgu=mysql_query(“SELECT * FROM table ORDER by rand() LIMIT 1“); Daha fazlası icin bu makaleyi inceleyiniz: http://www.learningmovabletype.com/a/001037random_quotes/

Newsletter

↑
  • Home
  • About Me
  • Contact Me