473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

img loop from mysql stored path.

201 100+
hello -

i need to implement this script to use a counter as to out put the data in columns and rows.

this pulls the data fine no problem just need to lay the data out instead of just in rows. i've tried adding tbl row headers, arrays, but this (do while) errors on me.

I dont know what im not doing correct.

here is my sample code with out the array or db links. just echoing the image.

im using cs4 dw.

Expand|Select|Wrap|Line Numbers
  1.         <?php do { ?>
  2.          <tr>
  3.               <td align="center" ><p><?php echo $row_image['description']; ?> </p>
  4.               <p><img src="<?php echo $row_image['file-system']; ?>" height="120" width="120" align="middle" /></p></td>
  5.           </tr>
  6.        <?php } while ($row_image = mysql_fetch_assoc($image)); ?>
  7.  
  8.  
thanks in advance for your help,

theo werntz
Jan 15 '10 #1
6 1910
Markus
6,050 Expert 4TB
There is a fundamental difference between the do-while loop and the while loop. With the do-while loop, the code between the curly-braces is always executed at least once with disregard to what happens in the while's parenthesis. That is, the variable $row_image is defined only after the first execution of the loop. Therefore, in the do-while loop, you are initially making a call to an undefined variable

This can be correct by making the loop a while loop instead.
Jan 15 '10 #2
wizardry
201 100+
thanks for the reply. i like the do while loop. will repost once resolved. i found out what was the error.

thanks again.
Jan 15 '10 #3
wizardry
201 100+
i've completed it thanks. can you send me a link with all the articles that you guys have covered already? it seems that im running into issues that are already have been solved or other techniques on solving.
Jan 17 '10 #4
NeoPa
32,556 Expert Mod 16PB
I suggest if you run into any issues that you look into them and find solutions yourself (Many can be found within our site).

While we like to be helpful and share our knowledge, we do not see ourselves as clerks to the membership. You will need to do your own leg-work I'm afraid.
Jan 17 '10 #5
wizardry
201 100+
sure not a problem. this is the methodology that i have been using, doing my own work; trying to find resolutions or new insights on debugging.

i was just inquiring about the insights that you have, below the answers. is their another link or sub domain name that has the articles where people ( members, moderators, admins, etc... ) write articles?
Jan 17 '10 #6
MMcCarthy
14,534 Expert Mod 8TB
The insights section is where members articles are written. There is an insights section in each forum.
Jan 18 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
2
by: Otto Leholt | last post by:
Hi I have made several website using MS Access and asp. Now I need to upgrade from Accesss to MYSQL - I got my website working with MYSQL on my local PC - but now the problem is how I get it...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
3
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard...
5
by: linuxlover992000 | last post by:
I am a newbie in the world of MySQL. In fact I enabled it in my Linux box only because it is required to run WordPress (the blogging software). I was trying to plan ahead and figure out a way to...
5
by: news.telia.net | last post by:
Hi! I have a question. I have installed php and mysql on an apache-server on windows and I can't connect to the server. I tried to create a database (since I am trying to learn howto). My...
1
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to...
20
by: _mario.lat | last post by:
hallo, I use PHP and I'd like to not write in hardcoded way password and login to access to mysql. how to not write password in code for access to mysql? How can I do? I'd like that who see my...
1
by: zaheerusman | last post by:
Hi, I am using flex for interface, java for intermediate code and mysql for DB. My website contains videos so instead of uploading them on db, i have instead put a path in db and stored videos on...
22
by: skysober | last post by:
I have read and read about mysql, which I am sure is just like the quoted, "linux is very friendy, but it just chooses who it wants to be friends with..." My first attempt to read the database in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.