Help create a database based on the request.

<?php $sql = "SELECT pm.subject, pm.msg, users.name FROM pm LEFT JOIN users ON pm.id_to = users.id WHERE id_from=[id_текущего_пользователя]"; $resource = mysql_query($sql); if(mysql_num_rows($resource) != 0) { $array = array(); while($array[] = mysql_fetch_assoc($resource)); } ?> 

    1 answer 1

    Well, look at the request. It shows that you have two tables - pm and users , pm has id fields ( its key is not visible in the request, but it is :-D ), subject , msg , id_from , id_to and users have id , name . How to write a DDL Request guess? ( create table ... )

    • one
      ID field at the pm table, by the way, can not be - VasyOk
    • Can. But storing tables without a key is a perversion. - Chad