473,394 Members | 1,902 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,394 software developers and data experts.

array / mysql question

I have been using for a while a class to create photo albums. Shortly, an
array of photo's is declared, initially they are shown as thumbnails, by
clicking on a thumbnail a larger photo is shown and there are links to the
thumbnail list but also to the previous and next photo as the function
remembers which position the photo has got in the array.
Now I tried to do the same thing by retrieving photos from a mysql database
(which is much practical) by searching for filenames that start with a
certain string. It still works but curiously enough the reference to the
next and previous photo fails. Also the indicator "foto 1 van 10", "foto 2
van 10" doesn't work correctly in this variant.
I am not completely sure the error is in one of these functions but I guess
it must have to do with it

This is the code for the array, I used it at
http://www.parochiebeekendonk.nl/fconinck.php
function addThumbnails()//create an array of files to add {
$numargs = func_num_args();
$arg_list = func_get_args();
//$teller = 0;
for ($i = 0; $i < $numargs; $i++)
{
$this->foto_array[] = $arg_list[$i];
//$teller++;
}
}

//calling the class
$f = new fotoAlbum();
$f->addThumbnails("foto1.php","foto2.php",...)

Now the database code I used for
http://www.parochiebeekendonk.nl/ceci2k6.php

function getFromMySql($bestandspatroon)
{
$this->mysql = true;
$lengte = strlen($bestandspatroon);
$db = mysql_connect("servername", "login","password");
mysql_select_db("database",$db) or die ("FOUT: OPENEN
DATABASE MISLUKT");
$query = mysql_query("SELECT bestandsnaam from fotos where
LEFT(bestandsnaam, $lengte)='$bestandspatroon' order by bestandsnaam ASC",
$db);
while (list($bestandsnaam) = mysql_fetch_row($query))
{
$this->foto_array[] = $bestandsnaam;
}
mysql_close($db);
}

//calling the class
$f = new fotoAlbum();
$f->getFromMySql("ceci2k6")

As you can see on the pages, both pages load a list of thumbnail but the
latter only allows navigation by going to the thumbnail page, not to the
previous or next pages.

Thanks for any suggestions,

Martien,

Dec 1 '06 #1
12 1853
sorry I forgot to remove the expression $this->mysql = true; it was only
there for testing purposes.

Dec 1 '06 #2
Martien van Wanrooij wrote:
I have been using for a while a class to create photo albums. Shortly,
an array of photo's is declared, initially they are shown as thumbnails,
by clicking on a thumbnail a larger photo is shown and there are links
to the thumbnail list but also to the previous and next photo as the
function remembers which position the photo has got in the array.
Now I tried to do the same thing by retrieving photos from a mysql
database (which is much practical) by searching for filenames that start
with a certain string. It still works but curiously enough the reference
to the next and previous photo fails. Also the indicator "foto 1 van
10", "foto 2 van 10" doesn't work correctly in this variant.
I am not completely sure the error is in one of these functions but I
guess it must have to do with it

This is the code for the array, I used it at
http://www.parochiebeekendonk.nl/fconinck.php
function addThumbnails()//create an array of files to add {
$numargs = func_num_args();
$arg_list = func_get_args();
//$teller = 0;
for ($i = 0; $i < $numargs; $i++)
{
$this->foto_array[] = $arg_list[$i];
//$teller++;
}
}

//calling the class
$f = new fotoAlbum();
$f->addThumbnails("foto1.php","foto2.php",...)

I guess, but awfully hard to understand. A much easier way would be:

function addThumbnails($tn) {
if (isarray($tn)
for each($tn as $t)
$this->foto_array[]= $t;
else
$this->foto_array[] = $tn;
}

// calling the classs
$f = new fotoAlbum();
$f->addThumbnails(array('foto1.php', 'foto2.php' ...));

Arrays work well
Now the database code I used for
http://www.parochiebeekendonk.nl/ceci2k6.php

function getFromMySql($bestandspatroon)
{
$this->mysql = true;
$lengte = strlen($bestandspatroon);
$db = mysql_connect("servername", "login","password");
mysql_select_db("database",$db) or die ("FOUT: OPENEN
DATABASE MISLUKT");
$query = mysql_query("SELECT bestandsnaam from fotos
where LEFT(bestandsnaam, $lengte)='$bestandspatroon' order by
bestandsnaam ASC", $db);
while (list($bestandsnaam) = mysql_fetch_row($query))
{
$this->foto_array[] = $bestandsnaam;
}
mysql_close($db);
}

//calling the class
$f = new fotoAlbum();
$f->getFromMySql("ceci2k6")
How many entries do you have in your table which start with 'ceci2k6'?
And what is in your array after the MySQL call?

P.S. This is much easier and probably faster:

$query = mysql_query("SELECT bestandsnaam from fotos
where bestandsnaam LIKE '{$bestandspatroon}% order by
bestandsnaam ASC", $db);
As you can see on the pages, both pages load a list of thumbnail but the
latter only allows navigation by going to the thumbnail page, not to the
previous or next pages.

Thanks for any suggestions,

Martien,

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 2 '06 #3

"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:4O******************************@comcast.com. ..
How many entries do you have in your table which start with 'ceci2k6'?
There are 10 entries in it.
Thank you for the other improvement suggestions, the "like" statement in
mysql works fine
Unfortunately the isArray() you suggested for addThumbnails - also tried
isarray() - is rejected as a call to an undefined function although it was
introduced in php 5.1 and the php version is 5.2.0
Dec 2 '06 #4
Martien van Wanrooij wrote:
>
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:4O******************************@comcast.com. ..
>How many entries do you have in your table which start with 'ceci2k6'?

There are 10 entries in it.
Thank you for the other improvement suggestions, the "like" statement in
mysql works fine
Unfortunately the isArray() you suggested for addThumbnails - also
tried isarray() - is rejected as a call to an undefined function
although it was introduced in php 5.1 and the php version is 5.2.0

Sorry, it's is_array() - see the manual.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 2 '06 #5

"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:7Y******************************@comcast.com. ..
Sorry, it's is_array() - see the manual.
Thanks again for the additional info and you are right, this improvement
works properly. Unfortunately it still doesn't resolve the original problem
I posted but this feedback for other improvements is equally welcome :)

Dec 2 '06 #6
Martien van Wanrooij wrote:
>
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:7Y******************************@comcast.com. ..
>Sorry, it's is_array() - see the manual.

Thanks again for the additional info and you are right, this improvement
works properly. Unfortunately it still doesn't resolve the original
problem I posted but this feedback for other improvements is equally
welcome :)
That's because you still haven't answered the question - what's in
foto_array after it has been populated?

Of course there are a lot of other possibilities which we can't discuss
because you didn't post the code you use for going to the next (or
previous) picture, you haven't told us how you get the list of pictures
on the next page (i.e. do you save data in the session or requery the
database?).

Sorry, my crystal ball isn't working tonight. I can't do much without
sufficient information. :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 3 '06 #7

"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:Gv******************************@comcast.com. ..
That's because you still haven't answered the question - what's in
foto_array after it has been populated?
Jerry first of all thanks for helping me so much. Anyway in both cases, both
with getFromMySql and with the addThumbnails functions the array is
populated with photos like like ceci2k600.jpg, ceci2k601.jpg etc.(I hope I
understood your question correctly) thats why the function toonoverzicht
works correctly in both cases. But as I said, with the getFromMySql
function some info is lost when one photo is shown. In my first posting I
didn't want to post a too large piece of code but now I think it is better
to post it completely. I have tried to make it as modular as possible but I
must admit I am not completely successfull in it. All kind of suggestions
are welcome of course :)

<?php class fotoAlbum
{
var $tmPrefix;//thumbnail prefix, by default it is q, I create my
thumbnails with irfanview but I am considering the gdi functions later
var $fotoPagina;//page that contains the script, default is
toonfoto.php
var $toevoeging;
var $foto_array = array();
var $dezePagina;
var $mysql = false; //only used to put an apology online, to show
that there are some errors on it
function __construct($tmPrefix="q", $fotoPagina =
"toonfoto.php",$toevoeging ="")
{
$this->tmPrefix = $tmPrefix;
$this->fotoPagina = $fotoPagina;
$this->toevoeging = $toevoeging;
}
function getFromMySql($bestandspatroon)
{
$this->mysql = true;
$db = mysql_connect("server", "login","password");
mysql_select_db("database",$db) or die ("FOUT: OPENEN
DATABASE MISLUKT");
$query = mysql_query("SELECT bestandsnaam from fotos where
bestandsnaam LIKE '{$bestandspatroon}%' order by bestandsnaam ASC",
$db);
while (list($bestandsnaam) = mysql_fetch_row($query))
{
$this->foto_array[] = $bestandsnaam;
}
mysql_close($db);
}

function addThumbnails($tn)
{
if (is_array($tn))
{
foreach($tn as $t)
{
$this->foto_array[]= $t;
}
}
else
{
$this->foto_array[] = $tn;
}
}

function arrayposition($haystack, $needle)//php seems not ta have a
standard function to do this, suggestions for improvement are welcome of
course
{
$getal = 0;
$lengte = count($haystack);
for ($i = 0; $i < $lengte; $i++)
{
if ($needle == $haystack[$i])
{
return $i;
}
}
return -1;

}

function toonOverzicht($kolommen, $cssClass = "thumb")/* show the
thumbnails, this one works correctly */
{ if($this->mysql){
?>
<p class= "krktitel" style =
"background-color:yellow"><marquee>Momenteel zijn wij bezig met een aantal
technische aanpassingen aan onze fotopagina's. Mogelijk werken deze pagina's
daarom niet geheel correct. Onze excuses voor het ongemak.</marquee></p>
<?php }
$this->dezePagina = $_SERVER['PHP_SELF'];
$teller = 0;
$lengte = count($this->foto_array);
print "<table width = \"600\"><tr>";
foreach($this->foto_array as $plaatje)
{
print "<td class = \"$cssClass\" align =
\"center\"><a href =\"$this->dezePagina?plaatje=$plaatje\"><img src =
\"$this->tmPrefix$plaatje\" align = \"center\"></a></td>\n";
$teller++;
if ($teller % $kolommen == 0 )
{
echo"</tr>\n";
if ($teller < $lengte) echo "<tr>";
}

}
while($teller % $kolommen 0)
{
echo"<td class = \"$cssClass\"></td>";
$teller++;
}

echo "</tr></table>";
}
function toonEenFoto($foto)
{
$this->dezePagina = $_SERVER['PHP_SELF'];
$totaalFotos = count($this->foto_array);
$hoeveelste = $this->arrayposition($this->foto_array, $foto)
+ 1;
//$hoeveelste = array_search($foto, $this->foto_array);
echo "<span style =
\"color:#990000;font-size:smaller\";>Foto $hoeveelste van
$totaalFotos</span><br>";
$volgendeFoto = "";
$vorigeFoto = "";

/*previous picture*/
if ($hoeveelste 1)
{
$vorigeFoto = $this->foto_array[$hoeveelste - 2];
$verwijzing = "<a href = \"$this->dezePagina";
$verwijzing .= "?plaatje=$vorigeFoto\"";
$verwijzing .= "<< Vorige << </a>";
echo $verwijzing;
}
else echo "<span style = \"color:lightgrey\"<< Vorige <<
</span>";
/* thumbnail page */
echo "&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;<a href =
\"$this->dezePagina\">Terug naar het
overzicht</a>&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;";
/* next picture*/
if ($hoeveelste < $totaalFotos)
{
$volgendeFoto = $this->foto_array[$hoeveelste];
$verwijzing = "<a href = \"$this->dezePagina";
$verwijzing .= "?plaatje=$volgendeFoto\"";
$verwijzing .= "Volgende ></a>";
echo $verwijzing;
}
else echo "<span style = \"color:lightgrey\"Volgende >>
</span>";
echo "<p style = \"text-align:center;width:600px\"><img src
= \"$foto\"></p>";

}
/* check whether the thumbnails have to be shown or only one picture */
function swapDisplay($kolommen)
{
$plaatje = $_GET['plaatje'];
if (isset($plaatje)&&file_exists($plaatje))
{
$this->toonEenFoto($plaatje);
}
else
{
$this->toonOverzicht($kolommen);
}
}


}
?>

Dec 3 '06 #8
Martien van Wanrooij wrote:
>
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:Gv******************************@comcast.com. ..
>That's because you still haven't answered the question - what's in
foto_array after it has been populated?
Jerry first of all thanks for helping me so much. Anyway in both cases,
both with getFromMySql and with the addThumbnails functions the array
is populated with photos like like ceci2k600.jpg, ceci2k601.jpg etc.(I
hope I understood your question correctly) thats why the function
toonoverzicht works correctly in both cases. But as I said, with the
getFromMySql function some info is lost when one photo is shown. In my
first posting I didn't want to post a too large piece of code but now I
think it is better to post it completely. I have tried to make it as
modular as possible but I must admit I am not completely successfull in
it. All kind of suggestions are welcome of course :)

<?php class fotoAlbum
{
var $tmPrefix;//thumbnail prefix, by default it is q, I create my
thumbnails with irfanview but I am considering the gdi functions later
var $fotoPagina;//page that contains the script, default is
toonfoto.php
var $toevoeging;
var $foto_array = array();
var $dezePagina;
var $mysql = false; //only used to put an apology online, to show
that there are some errors on it
function __construct($tmPrefix="q", $fotoPagina =
"toonfoto.php",$toevoeging ="")
{
$this->tmPrefix = $tmPrefix;
$this->fotoPagina = $fotoPagina;
$this->toevoeging = $toevoeging;
}
function getFromMySql($bestandspatroon)
{
$this->mysql = true;
$db = mysql_connect("server", "login","password");
mysql_select_db("database",$db) or die ("FOUT: OPENEN
DATABASE MISLUKT");
$query = mysql_query("SELECT bestandsnaam from fotos
where bestandsnaam LIKE '{$bestandspatroon}%' order by bestandsnaam
ASC", $db);
while (list($bestandsnaam) = mysql_fetch_row($query))
{
$this->foto_array[] = $bestandsnaam;
}
mysql_close($db);
}

function addThumbnails($tn)
{
if (is_array($tn))
{
foreach($tn as $t)
{
$this->foto_array[]= $t;
}
}
else
{
$this->foto_array[] = $tn;
}
}

function arrayposition($haystack, $needle)//php seems not ta have
a standard function to do this, suggestions for improvement are welcome
of course
{
$getal = 0;
$lengte = count($haystack);
for ($i = 0; $i < $lengte; $i++)
{
if ($needle == $haystack[$i])
{
return $i;
}
}
return -1;

}

function toonOverzicht($kolommen, $cssClass = "thumb")/* show the
thumbnails, this one works correctly */
{ if($this->mysql){
?>
<p class= "krktitel" style =
"background-color:yellow"><marquee>Momenteel zijn wij bezig met een
aantal technische aanpassingen aan onze fotopagina's. Mogelijk werken
deze pagina's daarom niet geheel correct. Onze excuses voor het
ongemak.</marquee></p>
<?php }
$this->dezePagina = $_SERVER['PHP_SELF'];
$teller = 0;
$lengte = count($this->foto_array);
print "<table width = \"600\"><tr>";
foreach($this->foto_array as $plaatje)
{
print "<td class = \"$cssClass\" align =
\"center\"><a href =\"$this->dezePagina?plaatje=$plaatje\"><img src =
\"$this->tmPrefix$plaatje\" align = \"center\"></a></td>\n";
$teller++;
if ($teller % $kolommen == 0 )
{
echo"</tr>\n";
if ($teller < $lengte) echo "<tr>";
}

}
while($teller % $kolommen 0)
{
echo"<td class = \"$cssClass\"></td>";
$teller++;
}

echo "</tr></table>";
}
function toonEenFoto($foto)
{
$this->dezePagina = $_SERVER['PHP_SELF'];
$totaalFotos = count($this->foto_array);
$hoeveelste = $this->arrayposition($this->foto_array,
$foto) + 1;
//$hoeveelste = array_search($foto, $this->foto_array);
echo "<span style =
\"color:#990000;font-size:smaller\";>Foto $hoeveelste van
$totaalFotos</span><br>";
$volgendeFoto = "";
$vorigeFoto = "";

/*previous picture*/
if ($hoeveelste 1)
{
$vorigeFoto = $this->foto_array[$hoeveelste - 2];
$verwijzing = "<a href = \"$this->dezePagina";
$verwijzing .= "?plaatje=$vorigeFoto\"";
$verwijzing .= "<< Vorige << </a>";
echo $verwijzing;
}
else echo "<span style = \"color:lightgrey\"<< Vorige
<< </span>";
/* thumbnail page */
echo "&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;<a href =
\"$this->dezePagina\">Terug naar het
overzicht</a>&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;";
/* next picture*/
if ($hoeveelste < $totaalFotos)
{
$volgendeFoto = $this->foto_array[$hoeveelste];
$verwijzing = "<a href = \"$this->dezePagina";
$verwijzing .= "?plaatje=$volgendeFoto\"";
$verwijzing .= "Volgende ></a>";
echo $verwijzing;
}
else echo "<span style = \"color:lightgrey\"Volgende
></span>";
echo "<p style = \"text-align:center;width:600px\"><img
src = \"$foto\"></p>";

}
/* check whether the thumbnails have to be shown or only one picture */
function swapDisplay($kolommen)
{
$plaatje = $_GET['plaatje'];
if (isset($plaatje)&&file_exists($plaatje))
{
$this->toonEenFoto($plaatje);
}
else
{
$this->toonOverzicht($kolommen);
}
}


}
?>
Hi, Martien,

Sorry if my last response sounded a bit abrupt. I just re-read it, and
the tone wasn't what I planned. That's what I get for responding when
I'm tired :-(.

OK, the class itself looks OK, from what I saw (but I didn't go into a
lot of depth).

OK, you think the class is populated correctly before you display a
picture. Have you actually printed out the contents of $foto_array at
the end of the getFromMySql() function? I never assume something should
be there - I *always* print it out to make sure! :-)

And you say when you display the first picture, "some information is
being lost". How are you saving the information in the class? Are you
putting it in a session, for instance? Or are you pulling the
information from the database again? If the latter, again, what are the
contents for $foto_array at the end of getFromMySql()?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 4 '06 #9

"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:HK******************************@comcast.com. ..
OK, you think the class is populated correctly before you display a
picture. Have you actually printed out the contents of $foto_array at the
end of the getFromMySql() function? I never assume something should be
there - I *always* print it out to make sure! :-)
Well I actually printed it out now just at the end of the getFromMySql()
function and curiously enough the whole array is printed. The only thing
that not works (when I retrieve the fotos with getFromMySql) is the foto 0
van 10 statement which should be foto 1 van 10, foto 2 van 10 and probably
for the same reason the reference to the previous foto is grayed out and
instead of the next foto a reference to the first one is made.
I also stored the array into a session but again without any result
BTW the code for instantiating the fotoclass is as follows
<?php
session_start();
$title = " - Ceciliaviering 2006"?>
<?php include("header.php") ?>
<?php include ("fotoclas.php") ?>
<p class = "krktitel" align = "center">Ceciliaviering 2006<p>
<DIV STYLE="text-align:center">
<?php
$f = new fotoAlbum("q","ceci2k6.php");
/*
commented out here but this is what works in other pages
$f->addThumbnails(array(
"ceci2k600.jpg",
"ceci2k601.jpg",
"ceci2k602.jpg",
"ceci2k603.jpg",
"ceci2k604.jpg",
"ceci2k605.jpg",
"ceci2k606.jpg",
"ceci2k607.jpg",
"ceci2k608.jpg",
"ceci2k609.jpg"
));*/
$f->getFromMySql("ceci2k6"); //the function with which I have troubles
$f->swapDisplay(4);
?></DIV>
<?php include ("footer.php") ?>
Dec 4 '06 #10
Martien van Wanrooij wrote:
>
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:HK******************************@comcast.com. ..
>OK, you think the class is populated correctly before you display a
picture. Have you actually printed out the contents of $foto_array at
the end of the getFromMySql() function? I never assume something
should be there - I *always* print it out to make sure! :-)

Well I actually printed it out now just at the end of the getFromMySql()
function and curiously enough the whole array is printed. The only thing
that not works (when I retrieve the fotos with getFromMySql) is the foto
0 van 10 statement which should be foto 1 van 10, foto 2 van 10 and
probably for the same reason the reference to the previous foto is
grayed out and instead of the next foto a reference to the first one is
made.
I also stored the array into a session but again without any result
BTW the code for instantiating the fotoclass is as follows
<?php
session_start();
$title = " - Ceciliaviering 2006"?>
<?php include("header.php") ?>
<?php include ("fotoclas.php") ?>
<p class = "krktitel" align = "center">Ceciliaviering 2006<p>
<DIV STYLE="text-align:center">
<?php
$f = new fotoAlbum("q","ceci2k6.php");
/*
commented out here but this is what works in other pages
$f->addThumbnails(array(
"ceci2k600.jpg",
"ceci2k601.jpg",
"ceci2k602.jpg",
"ceci2k603.jpg",
"ceci2k604.jpg",
"ceci2k605.jpg",
"ceci2k606.jpg",
"ceci2k607.jpg",
"ceci2k608.jpg",
"ceci2k609.jpg"
));*/
$f->getFromMySql("ceci2k6"); //the function with which I have troubles
$f->swapDisplay(4);
?></DIV>
<?php include ("footer.php") ?>

Martein,

OK, I'm just having a little trouble understanding here. After your
call to getFromMySql(), does the array actually contain the values

"ceci2k600.jpg",
"ceci2k601.jpg",
"ceci2k602.jpg",
"ceci2k603.jpg",
"ceci2k604.jpg",
"ceci2k605.jpg",
"ceci2k606.jpg",
"ceci2k607.jpg",
"ceci2k608.jpg",
"ceci2k609.jpg"

I now you said it does after the all to addThumnails(), but I'm still
not clear what's in it after the call to getFromMySql().

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 5 '06 #11

"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:t9******************************@comcast.com. ..
>
OK, I'm just having a little trouble understanding here. After your call
to getFromMySql(), does the array actually contain the values

"ceci2k600.jpg",
"ceci2k601.jpg",
"ceci2k602.jpg",
"ceci2k603.jpg",
"ceci2k604.jpg",
"ceci2k605.jpg",
"ceci2k606.jpg",
"ceci2k607.jpg",
"ceci2k608.jpg",
"ceci2k609.jpg"
Yes it does.. but finally I found the solution, the problem was somewhere
else. I had used a script to add the filenames to the database and it turned
out in that script, some spaces were added to each. I used rtrim for the
result and everything works fine now. So in the database there was not
"ceci2k600.jpg" but "ceci2k600.jpg " .
Thanks for all the help anyway and sorry for having bothered you so much

Martien.

Dec 5 '06 #12
Martien van Wanrooij wrote:
>
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:t9******************************@comcast.com. ..
>>
OK, I'm just having a little trouble understanding here. After your
call to getFromMySql(), does the array actually contain the values

"ceci2k600.jpg",
"ceci2k601.jpg",
"ceci2k602.jpg",
"ceci2k603.jpg",
"ceci2k604.jpg",
"ceci2k605.jpg",
"ceci2k606.jpg",
"ceci2k607.jpg",
"ceci2k608.jpg",
"ceci2k609.jpg"

Yes it does.. but finally I found the solution, the problem was
somewhere else. I had used a script to add the filenames to the database
and it turned out in that script, some spaces were added to each. I used
rtrim for the result and everything works fine now. So in the database
there was not "ceci2k600.jpg" but "ceci2k600.jpg " .
Thanks for all the help anyway and sorry for having bothered you so much

Martien.
Martien,

Ah, yes, and such problems are very difficult to see on a screen. Glad
you found your bug!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 5 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: davidv | last post by:
I am building a very simple form that takes text and inserts data in a MySQL db. I would like my "logic" to simply insert the value in to the field in the database that matches the name from the...
2
by: Steve | last post by:
I've a question regarding a bit of code I have. On my site I have a set of semi-static data (changes once a month or so) that needs to be displayed in various places around the site and integrated...
1
by: Jonny Tango | last post by:
Hello everyone. Q. How do I create a dynamically-generated drop-down list for use in an array. I'm using PHP with a MySQL database (through phpMyAdmin) My database table is called...
1
by: jonnytansey2 | last post by:
Can anyone out there give me a pointer regarding creating a dynamically-generated drop-down list connected to an array? And is that question as clear as chocolate spread? Here's what I've got....
38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
2
by: rjames.clarke | last post by:
I want to check if any of the items in a PHP array exist in a MySQL table. What is the best way to do this with making repeated calls to the database for each item? Actual application is: I...
5
by: elyob | last post by:
Hi, I've got a database that outputs markers on a google map project. The problem I am encountering is that some businesses have been located the same latitude and longitude, therefore markers...
6
by: bill | last post by:
I am about to start on a module that will accept a location from a user, use Google geolocation services to get the lat/lon and then compute the distance from the site visitor to about 100 kennels...
5
by: Anthony2oo5 | last post by:
Hello people, just a quick question I have here. My array looks like this: Array ( => Array ( => 15 => example.com => examplecom => NshKsi23
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.