Ch0cu3r Posted September 3, 2014 Share Posted September 3, 2014 Yes. Open a <table> and <tr> tag before the echo and then wrap the variables in <td></td> tags followed by the closing </tr> and </table> tags. Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489832 Share on other sites More sharing options...
RidgeandGable Posted September 3, 2014 Author Share Posted September 3, 2014 cheers got it working <table border="3"> <tr> <td>id</td> <td>username</td> <td>datebooked</td> <td>timebooked</td> <td>notes</td> </tr> <?php do { ?> <tr> <td><?php echo $row['id']; ?></td> <td><?php echo $row['username']; ?></td> <td><?php echo $row['datebooked']; ?></td> <td><?php echo $row['timebooked']; ?></td> <td><?php echo $row['notes']; ?></td> </tr> <?php } while ($row = mysql_fetch_assoc($Recordset1)); ?> </table> Just looking how to add colour change Slowly winning Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489833 Share on other sites More sharing options...
Ch0cu3r Posted September 3, 2014 Share Posted September 3, 2014 Then you need to start learning CSS Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489834 Share on other sites More sharing options...
RidgeandGable Posted September 3, 2014 Author Share Posted September 3, 2014 lol I figure it out. My head is banging, but big improvements on site now tho http://scotair.noip.me I have left the test username on so User - alex & password alex I did want to ask one quick question but feel free to tell me where to go lolWould this code take much to alter and instead of going to download, display the files by a centre size on page? Reason I ask is because that little bit of code you done works so well, it would also make an ideal little pic gallery allowing me to upload etc by username? echo '<h2>Customer Invoices</h2>'; // get the files belonging to the logged in user $result = mysql_query('SELECT upid, name, size FROM upload WHERE username=\''.mysql_real_escape_string($_SESSION['MM_Username']).'\''); // check query did execute without errors if($result) { // output each file while($row = mysql_fetch_assoc($result)) { echo '<a href="download1.php?upid='.$row['upid'].'">'.$row['name'].'</a><br />'; } // query did not execute, log or show error message } else { trigger_error('Cannot get users files from database: ' . mysql_error()); } ?> instead of tbl upload it would be table gallery? Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489837 Share on other sites More sharing options...
RidgeandGable Posted September 3, 2014 Author Share Posted September 3, 2014 or instead of download, display in a popup? Just a thought Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489838 Share on other sites More sharing options...
jazzman1 Posted September 3, 2014 Share Posted September 3, 2014 (edited) No. Don't. Just google - php gallery tutorial, find some decent one and pick it up. I am not trolling or being glib, but you are not a guy who is trying to learn into the good programming habits BTW: thanks for the beer mate Edited September 3, 2014 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489841 Share on other sites More sharing options...
RidgeandGable Posted September 4, 2014 Author Share Posted September 4, 2014 Ha ha ok lol, ill leave that for another day, i thought a simple target=_blank or something mightve worked lol but like you say im not good Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489845 Share on other sites More sharing options...
jazzman1 Posted September 4, 2014 Share Posted September 4, 2014 Ha ha ok lol, ill leave that for another day.... it wisely Quote Link to comment https://forums.phpfreaks.com/topic/290785-download-file-from-mysql/page/3/#findComment-1489846 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.