MySQL and PHP Examples
Some examples using MySQL with PHP
Some MySQL and PHP examples where multiple tables are used




  $myquery = 'SELECT * FROM HashTagTable, SocialTable 

              WHERE HashTagTable.postid = SocialTable.postid AND hashtag = "'.$hashtag.'" 

              ORDER by SocialTable.date DESC LIMIT '.$maxp;



  foreach ($dbh->query($myquery) as $row) 

  {

    $res = $res.$row['postid'];

  }




and where SQL commands are executed in a single line:


  $deleteTable = "DELETE FROM HashTagTable";

  $count1 = $dbh->exec($deleteTable);




Cleanup multi-byte characters (somewhat) - i.e. for author names

Note that in the file php.ini, you might need to uncomment the line:

extension=php_mbstring.dll

because multi-byte operations are not by default enabled.


  $authors = mb_convert_encoding($authors, "HTML-ENTITIES", "UTF-8");

Media Lab Overview
LIACS Homepage
MM Conf
ACM Multimedia
ACM ICMR
IAPR ICPR
Science Direct
IEEE Library
LIACS Publications
ACM Digital Library