Category Archives: mysql

Using Variables or Placeholders in MySql

For prepared statements, you can use placeholders (supported as of MySQL version 5.0.7). The following statements will return one row from the tbl table: SET @a=1; PREPARE STMT FROM ‘SELECT * FROM tbl LIMIT ?’; EXECUTE STMT USING @a; The … Continue reading

Posted in mysql | Tagged | Leave a comment

mysql: How to Join Several Tables

How to Join Several Tables Very small and powerfull snippet SELECT * FROM tickets AS ti LEFT JOIN users AS u ON ti.user = u.id LEFT JOIN ticket_statuses AS ti_st ON ti.status = ti_st.id

Posted in mysql | Tagged | Leave a comment