desoto0311 Posted April 4, 2009 Share Posted April 4, 2009 I've got two tables laid out as such: table 1: "articles" L id L catid L title L author L desc table 2: "files" L id L articleid L filename I've got the SQL statement: $sql = "SELECT * FROM articles, files WHERE files.articleid = articles.id"; and a while statement to create my variables. (for later placement into a smarty template) while ($a_row = sqlFetchArray($res)) { $records[$c]["id"] = $a_row["id"]; // note: this repeats for all variables. } The problem is, when referencing said variables in the $records array, it seems I can only output those from the first table (articles). Those from the second table aren't seen at all. Am I missing something? ------------------------------- MySQL: v.5.0 PHP: v.5.2.5 Thanks, -D Link to comment https://forums.phpfreaks.com/topic/152525-mysql-array-wjoin-variables/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.