Heath Posted December 18, 2007 Share Posted December 18, 2007 I have been trying to merge 2 seperate codes I made to show up side by side. In order to do this though, I need to be able to run multiple mysql queries... Here are the 2 queries. Query 1- $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); Query 2- $query2 = $DB->query("SELECT id, evento FROM mkp_gallery_events ORDER BY `id` DESC LIMIT $limit; "); Any clue how to accomplish this? Quote Link to comment Share on other sites More sharing options...
corbin Posted December 18, 2007 Share Posted December 18, 2007 Hmmm.... That should work assuming $DB is valid.... What exactly are you trying to do? Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 18, 2007 Share Posted December 18, 2007 what? explain it better ! Quote Link to comment Share on other sites More sharing options...
Heath Posted December 18, 2007 Author Share Posted December 18, 2007 Here is every thing I have. Currently. When it outputs. What should be the 2nd table in the 2nd part of this still pulls every thing from query2 and i can't figure out why. <?php $limit = 10; $cut = 1000; $content = ""; $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); while ($row = $DB->fetch_row($query)) { $idu = $row['id']; $umes = ""; $message = substr($row['description'], 0, $cut); $message = str_replace("<br>", " ", $message); $message = explode(" ", $message); foreach ($message as $value) { if (strlen($value) > 20) { $value = substr($value, 0, 22); } $umes .= $value." "; } $content.= " <td><tr> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$idu\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row['titolo']}</a> </td> </tr>"; } if($idu == NULL) { $content = " <tr> <td align=\"center\"> There are no Files </td> </tr> "; } if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) { $content = " <tr> <td align=\"center\"> {$this->lang['gallery_noallow']} </td> </tr><td> "; } unset($row); unset($umes); unset($message); unset($idu); //2nd part $query = $DB->query("SELECT id, titolo, file FROM mkp_gallery where validate = '1' ORDER BY `id` DESC LIMIT $limit"); $query2 = $DB->query("SELECT id, evento FROM mkp_gallery_events ORDER BY `id` DESC LIMIT $limit; "); while ($row2 = $DB->fetch_row($query2)) { $idu = $row2['id']; $idb = $row['id']; $umes = ""; $message = substr($row['description'], 0, $cut); $message = str_replace("<br>", " ", $message); $message = explode(" ", $message); foreach ($message as $value) { if (strlen($value) > 20) { $value = substr($value, 0, 22); } $umes .= $value." "; } $content.= " <td> <tr> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=section_view&idev=$idu\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row2['evento']}</a></td> <td class=\"frontpics\"><a href=\"$this->siteurl/index.php?ind=gallery&op=foto_show&ida=$idb\" class=\"uno\"><img src=/images/front-page-bullet.jpg> {$row['titolo']}</a> </td> </tr>"; } if($idu == NULL) { $content = " <tr> <td align=\"center\"> There are no Files </td> </tr> "; } if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) { $content = " <tr> <td align=\"center\"> {$this->lang['gallery_noallow']} </td> </tr><td> "; } unset($row); unset($umes); unset($message); unset($idu); ?> I am trying to get the content to show up side by side, opposed to one long list. So it would look like this (Block One ) (Block 1 2nd Query ) (Block Two ) (Block 2 2nd Query ) Right now its just straight down 10, then the 2nd Queries 10. With empty fields with just the image and empty tables with no title like it should be. Thank you. I appreciate the help. Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 18, 2007 Share Posted December 18, 2007 can you give us the link of your site ? You use class to manipulate sql queries so i cant see completely how it works Quote Link to comment Share on other sites More sharing options...
Heath Posted December 18, 2007 Author Share Posted December 18, 2007 popuplace.com sorry i didn't want to seem like a spammer or some thing by putting a link. its under the "New Pictures" section on the front page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.