473,692 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loading png images into a mysql table/database

Hello Members,

I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem. I am using
chunk_split(dat a) and the base64_encode and base64_decode on the files.

I do a select from the database, and then echo the image (with
header(Content Type: image/jpeg)
and the decoded image displays fine. Yes, I have tried header(Content
Type: image/png), without
success.

My problem is png images. Is there something that I need to do
different in terms on reading/encodeing/decodeing the png image? I am
putting its "binary" data into the db table.
But when I do a select on a png image - it never displays in the
browser.

I am not using file/path names as references, but actually putting the
image in the db.

Here is a sample of code I use to insert the data into the table, and
to select the code from the table.

load image(s):
<?php
while ($file = readdir($dir_ha ndle))
{
$filetyp = substr($file, -3);
if ($filetyp == 'png' OR $filetyp == 'jpg')
{
$handle = fopen($path . "/" . $file,'r');
$file_content = fread($handle,f ilesize($path . "/" . $file));
fclose($handle) ;

$encoded = chunk_split(bas e64_encode($fil e_content));
$sql = "INSERT INTO images SET sixfourdata='$e ncoded'";
mysql_query($sq l);
}
}
?>

display images:

<?php
$result = @mysql_query("S ELECT * FROM images WHERE id=" . $img . "");

if (!$result)
{
echo("Error performing query: " . mysql_error() . "");
exit();
}

while ( $row = mysql_fetch_arr ay($result) )
{
$imgid = $row["id"];
$encodeddata = $row["sixfourdat a"];
}
?>

<?php
//echo base64_decode($ encodeddata);
echo $encodeddata;
?>

This process seems to always work with jpegs.

Thanks

ewholz

Dec 22 '06 #1
10 13402

eholz1 schrieb:
Hello Members,

I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.
Just a small performance note:

If you use blobs and various other types, MySQL is likely to fall back
in table-scan mode which might slow down your queries very much. A
table-scan needs to read the full table data, at least much more, than
an index.

Even if you use some indexes, MySQL might not use them - the exact
behaviour depends on your indexes and queries.

Are there good reasons to keep image data in tables and not in file
systems - other than simpler coding, e.g.?

Dec 22 '06 #2
Very True, I use to run a photo hosting web site and I experimented
with this in the beginning and oh man once there was 100,000+ images in
there the MySQL DB slowed down quite significantly. Almost 3 gigs of
data in a MySQL table is not the way to do it, I have found the file
system does a much better job holding and serving images.

What I ended up doing is just creating a simple mod 30 hash folder
setup to store all the actual photos and then have a table to store all
the attributes of the photos. This improved the performance very
significantly over the pure MySQL setup. Also separating the photos
into 30 different folders helped in case I actually had to do any
folder scans, it would not need to scan though all the photos just
1/30th of them.

I hope this helps.
Nick D.

On Dec 21, 10:57 pm, "seaside" <seaside...@mac .comwrote:
eholz1 schrieb:
Hello Members,
I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.Just a small performance note:

If you use blobs and various other types, MySQL is likely to fall back
in table-scan mode which might slow down your queries very much. A
table-scan needs to read the full table data, at least much more, than
an index.

Even if you use some indexes, MySQL might not use them - the exact
behaviour depends on your indexes and queries.

Are there good reasons to keep image data in tables and not in file
systems - other than simpler coding, e.g.?
Dec 22 '06 #3
Hello Nick and Seaside (an den See!!),

The only reason I have for putting the image data in the table is for
learning and fun(??).
but it does seem like a better idea (now) to use a file system scheme,
like Nick mentions.

I will do a little research on the term "mod 30 hash folder" (i am
fairly new to this!!), and see what I can do with it. I may need to
get back and ask more questions.

Thanks for the good info,

eholz1 aka ewholz
Nick DeNardis wrote:
Very True, I use to run a photo hosting web site and I experimented
with this in the beginning and oh man once there was 100,000+ images in
there the MySQL DB slowed down quite significantly. Almost 3 gigs of
data in a MySQL table is not the way to do it, I have found the file
system does a much better job holding and serving images.

What I ended up doing is just creating a simple mod 30 hash folder
setup to store all the actual photos and then have a table to store all
the attributes of the photos. This improved the performance very
significantly over the pure MySQL setup. Also separating the photos
into 30 different folders helped in case I actually had to do any
folder scans, it would not need to scan though all the photos just
1/30th of them.

I hope this helps.
Nick D.

On Dec 21, 10:57 pm, "seaside" <seaside...@mac .comwrote:
eholz1 schrieb:
Hello Members,
I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.Just a small performance note:
If you use blobs and various other types, MySQL is likely to fall back
in table-scan mode which might slow down your queries very much. A
table-scan needs to read the full table data, at least much more, than
an index.

Even if you use some indexes, MySQL might not use them - the exact
behaviour depends on your indexes and queries.

Are there good reasons to keep image data in tables and not in file
systems - other than simpler coding, e.g.?
Dec 22 '06 #4
eholz1 wrote:
Hello Nick and Seaside (an den See!!),

The only reason I have for putting the image data in the table is for
learning and fun(??).
but it does seem like a better idea (now) to use a file system scheme,
like Nick mentions.
I'd say go for the filesystem based solution too.

....but good on you for trying the DBMS route yourself before asking for
help.

Have you tried anything other than viewing the PNG in a browser? This is a
fairly easy think to try first - but if it doesn't work, try downloading
the file instead - does it have the same size? Does it load as a PNG image
from the filesystem? What's the diff like?

What you described should be completely reversible - if it works for JPEG,
it should work for PNG.

HTH

C.
Dec 22 '06 #5

seaside schrieb:
eholz1 schrieb:
Hello Members,

I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.

Just a small performance note:
Additionally, here is a bit more on MySQL:

- The query cache of MySQL is OFF by default. On a production system,
you should turn it on,
Since this might return significant better performance.

- You should keep all your queries in a separate module and call
function of this module from everywhere in your web-app.

Note, that MySQL only uses the query cache, if queries are absolutely
identical. Even if one character is lower-case in one query and
upper-case in the other, MySQL assumes them to be different. Same
applies to white-space.

Dec 23 '06 #6
eholz1,
What I mean by the "mod 30" hash folder is basically what I did was
setup 30 folders numbered (0-29) inside a directory. Then when ever a
photo is uploaded it would go to a temporary area then its primary key
would be modded by 30 to get a number between 0 and 29 then the photo
would be placed in that folder. So like this:

1. User uploads photo to temp directory.
2. Info is grabbed from the photo.
3. The information is inserted into the database.
4. The primary key is modded by 30, so $folder = ($primary_key % 30);
5. The photo is moved into that $folder.
6. A thumbnail is also created in the $folder/thumbs/ directory.

The things that would be stored in the database about the image are the
filename, hash folder so it does not have to be recalculated, original
width, original height, thumbnail width, thumbnail height, filetype,
filesize, and other things related to the user but nothing really too
crazy is stored in the database.

I hope this helps.
Nick D.

On Dec 22, 4:03 pm, "eholz1" <ewh...@gmail.c omwrote:
Hello Nick and Seaside (an den See!!),

The only reason I have for putting the image data in the table is for
learning and fun(??).
but it does seem like a better idea (now) to use a file system scheme,
like Nick mentions.

I will do a little research on the term "mod 30 hash folder" (i am
fairly new to this!!), and see what I can do with it. I may need to
get back and ask more questions.

Thanks for the good info,

eholz1 aka ewholz

Nick DeNardis wrote:
Very True, I use to run a photo hosting web site and I experimented
with this in the beginning and oh man once there was 100,000+ images in
there the MySQL DB slowed down quite significantly. Almost 3 gigs of
data in a MySQL table is not the way to do it, I have found the file
system does a much better job holding and serving images.
What I ended up doing is just creating a simple mod 30 hash folder
setup to store all the actual photos and then have a table to store all
the attributes of the photos. This improved the performance very
significantly over the pure MySQL setup. Also separating the photos
into 30 different folders helped in case I actually had to do any
folder scans, it would not need to scan though all the photos just
1/30th of them.
I hope this helps.
Nick D.
On Dec 21, 10:57 pm, "seaside" <seaside...@mac .comwrote:
eholz1 schrieb:
Hello Members,
I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.Just a small performance note:
If you use blobs and various other types, MySQL is likely to fall back
in table-scan mode which might slow down your queries very much. A
table-scan needs to read the full table data, at least much more, than
an index.
Even if you use some indexes, MySQL might not use them - the exact
behaviour depends on your indexes and queries.
Are there good reasons to keep image data in tables and not in file
systems - other than simpler coding, e.g.?
Dec 23 '06 #7
Code to Import images , with HTML goodness

===SNIP START===
<table>
<tr>
<td Colspan="2"><h3 >Insert Image</h3></td>
</tr>
<tr><form method="post" ENCTYPE="multip art/form-data" name="theForm">
<td>Image File</td>
<td><input type=file size="40" name=image></td>
</tr>
<tr>
<td colspan="2" align="center"> <input type="submit"
value="Upload"> </td>
</tr>
</form>
</table>
<?php
if(!$_FILES)die ();
require_once('./pathtodatabasec onnect.php');

$iname = $_FILES['image']['name'];

//Suck that file into a buffer
ob_start();
$contents = readfile($_FILE S['image']['tmp_name']);
$dump = ob_get_contents ();
ob_end_clean();
$data = unpack("H*hex", $dump);
$buf = $data['hex'];

//Check to see what we got it the dB already
$query = "select id from $database.image table where id = '$iname'";
$result = mysql_query($qu ery) or die();
$line = mssql_fetch_arr ay($result);

if($line == "") {
$query = "insert into $database.image stable (id, data) values
('$iname', 0x$buf)";
$status = "inserted into";
} else {
$query = "UPDATE $database.rober t.imagetable set data = 0x$buf where
id = '$iname'";
$status = "updated in";
}
mysql_query($qu ery) or die("error during query: $query");

?>
<dd>Image was <?echo $status;?databa se
<dd>Image Uploaded
<dd><img src="GetImage.p hp?image=<?=$in ame;?>">

</body>
</html>
===SNIP END===

Code to read images to screen

NOTE: This code is expecting to be called from an IMG tag: <img
src="phpfile.ph p?image=1">
===SNIP START===
<?php
require_once('./pathtodatabasec onnect.php');
function getImage($data) {
if(substr($data , 0, 3) == "GIF") return "gif";
if(substr($data , 0, 2) == "BM") return "bitmap";
if(substr($data , 6, 4) == "JFIF") return "jpeg";
if(substr($data , 1, 3) == "PNG") return "png";
if(substr($data , 0, 2) == "II" || substr($data, 0, 2) == "MM") return
"tiff";
return 1;
}
extract($_GET);
$query = "SELECT data from $database.image table where id = '$image'";
$result = mysql_query($qu ery) or die();
$data = mysql_result($r esult,0);
$len = strlen($data);
$type = getImage($data) ;
header("Content-type: $type");
header("Content-length: $len");
echo $data;
?>
===SNIP END===

NOTE: Loading images from a dB is really lame! I tried this (as above
code shows) and while it does work, it is extreamly slow and taxing on
your server unessecarly. I would suggest have a directory called
"images" and having a list of that directory in the database, that
would be much faster!

Example:
===SNIP START===
<img src="getImage.p hp?image=1">
<?php //this is are fake "getImage.p hp" file ;)
require_once('p athtodatabasefi le.php');
function getImage($data) {
if(substr($data , 0, 3) == "GIF") return "gif";
if(substr($data , 0, 2) == "BM") return "bitmap";
if(substr($data , 6, 4) == "JFIF") return "jpeg";
if(substr($data , 1, 3) == "PNG") return "png";
if(substr($data , 0, 2) == "II" || substr($data, 0, 2) == "MM") return
"tiff";
return 1;
}
$query="SELECT name from $database.image table WHERE value =
".$_GET['image'].";";
$name = mysql_result(my sql_query($quer y),0);
$buf=readfile(" ./images/$name");
$len=strlen($bu f);
$type=getImage( $buf);
header("Content-type: $type");
header("Content-length: $len");
echo $buf;
===SNIP END===

Wow, hope you can digest all that!

Cheers,
hackajar (at not spam, please don't spam) gmail (PLEASE NO SPAM) com
eholz1 wrote:
Hello Members,

I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem. I am using
chunk_split(dat a) and the base64_encode and base64_decode on the files.

I do a select from the database, and then echo the image (with
header(Content Type: image/jpeg)
and the decoded image displays fine. Yes, I have tried header(Content
Type: image/png), without
success.

My problem is png images. Is there something that I need to do
different in terms on reading/encodeing/decodeing the png image? I am
putting its "binary" data into the db table.
But when I do a select on a png image - it never displays in the
browser.

I am not using file/path names as references, but actually putting the
image in the db.

Here is a sample of code I use to insert the data into the table, and
to select the code from the table.

load image(s):
<?php
while ($file = readdir($dir_ha ndle))
{
$filetyp = substr($file, -3);
if ($filetyp == 'png' OR $filetyp == 'jpg')
{
$handle = fopen($path . "/" . $file,'r');
$file_content = fread($handle,f ilesize($path . "/" . $file));
fclose($handle) ;

$encoded = chunk_split(bas e64_encode($fil e_content));
$sql = "INSERT INTO images SET sixfourdata='$e ncoded'";
mysql_query($sq l);
}
}
?>

display images:

<?php
$result = @mysql_query("S ELECT * FROM images WHERE id=" . $img . "");

if (!$result)
{
echo("Error performing query: " . mysql_error() . "");
exit();
}

while ( $row = mysql_fetch_arr ay($result) )
{
$imgid = $row["id"];
$encodeddata = $row["sixfourdat a"];
}
?>

<?php
//echo base64_decode($ encodeddata);
echo $encodeddata;
?>

This process seems to always work with jpegs.

Thanks

ewholz
Dec 25 '06 #8
ewholz wrote:

Thanks Nick, I will give this a try. I like it, and it is much easier
than loading the binary image data in the db. (although loading binary
images was educational and fun!!!)

Thanks,

ewholz
!
Nick DeNardis wrote:
eholz1,
What I mean by the "mod 30" hash folder is basically what I did was
setup 30 folders numbered (0-29) inside a directory. Then when ever a
photo is uploaded it would go to a temporary area then its primary key
would be modded by 30 to get a number between 0 and 29 then the photo
would be placed in that folder. So like this:

1. User uploads photo to temp directory.
2. Info is grabbed from the photo.
3. The information is inserted into the database.
4. The primary key is modded by 30, so $folder = ($primary_key % 30);
5. The photo is moved into that $folder.
6. A thumbnail is also created in the $folder/thumbs/ directory.

The things that would be stored in the database about the image are the
filename, hash folder so it does not have to be recalculated, original
width, original height, thumbnail width, thumbnail height, filetype,
filesize, and other things related to the user but nothing really too
crazy is stored in the database.

I hope this helps.
Nick D.

On Dec 22, 4:03 pm, "eholz1" <ewh...@gmail.c omwrote:
Hello Nick and Seaside (an den See!!),

The only reason I have for putting the image data in the table is for
learning and fun(??).
but it does seem like a better idea (now) to use a file system scheme,
like Nick mentions.

I will do a little research on the term "mod 30 hash folder" (i am
fairly new to this!!), and see what I can do with it. I may need to
get back and ask more questions.

Thanks for the good info,

eholz1 aka ewholz

Nick DeNardis wrote:
Very True, I use to run a photo hosting web site and I experimented
with this in the beginning and oh man once there was 100,000+ images in
there the MySQL DB slowed down quite significantly. Almost 3 gigs of
data in a MySQL table is not the way to do it, I have found the file
system does a much better job holding and serving images.
What I ended up doing is just creating a simple mod 30 hash folder
setup to store all the actual photos and then have a table to store all
the attributes of the photos. This improved the performance very
significantly over the pure MySQL setup. Also separating the photos
into 30 different folders helped in case I actually had to do any
folder scans, it would not need to scan though all the photos just
1/30th of them.
I hope this helps.
Nick D.
On Dec 21, 10:57 pm, "seaside" <seaside...@mac .comwrote:
eholz1 schrieb:
Hello Members,
I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem.Just a small performance note:
If you use blobs and various other types, MySQL is likely to fall back
in table-scan mode which might slow down your queries very much. A
table-scan needs to read the full table data, at least much more, than
an index.
Even if you use some indexes, MySQL might not use them - the exact
behaviour depends on your indexes and queries.
Are there good reasons to keep image data in tables and not in file
systems - other than simpler coding, e.g.?
Dec 25 '06 #9
And hackajar - thanks for the handy sample code!!!
Maybe I get smart now!!!

ewholz,
ha******@gmail. com wrote:
Code to Import images , with HTML goodness

===SNIP START===
<table>
<tr>
<td Colspan="2"><h3 >Insert Image</h3></td>
</tr>
<tr><form method="post" ENCTYPE="multip art/form-data" name="theForm">
<td>Image File</td>
<td><input type=file size="40" name=image></td>
</tr>
<tr>
<td colspan="2" align="center"> <input type="submit"
value="Upload"> </td>
</tr>
</form>
</table>
<?php
if(!$_FILES)die ();
require_once('./pathtodatabasec onnect.php');

$iname = $_FILES['image']['name'];

//Suck that file into a buffer
ob_start();
$contents = readfile($_FILE S['image']['tmp_name']);
$dump = ob_get_contents ();
ob_end_clean();
$data = unpack("H*hex", $dump);
$buf = $data['hex'];

//Check to see what we got it the dB already
$query = "select id from $database.image table where id = '$iname'";
$result = mysql_query($qu ery) or die();
$line = mssql_fetch_arr ay($result);

if($line == "") {
$query = "insert into $database.image stable (id, data) values
('$iname', 0x$buf)";
$status = "inserted into";
} else {
$query = "UPDATE $database.rober t.imagetable set data = 0x$buf where
id = '$iname'";
$status = "updated in";
}
mysql_query($qu ery) or die("error during query: $query");

?>
<dd>Image was <?echo $status;?databa se
<dd>Image Uploaded
<dd><img src="GetImage.p hp?image=<?=$in ame;?>">

</body>
</html>
===SNIP END===

Code to read images to screen

NOTE: This code is expecting to be called from an IMG tag: <img
src="phpfile.ph p?image=1">
===SNIP START===
<?php
require_once('./pathtodatabasec onnect.php');
function getImage($data) {
if(substr($data , 0, 3) == "GIF") return "gif";
if(substr($data , 0, 2) == "BM") return "bitmap";
if(substr($data , 6, 4) == "JFIF") return "jpeg";
if(substr($data , 1, 3) == "PNG") return "png";
if(substr($data , 0, 2) == "II" || substr($data, 0, 2) == "MM") return
"tiff";
return 1;
}
extract($_GET);
$query = "SELECT data from $database.image table where id = '$image'";
$result = mysql_query($qu ery) or die();
$data = mysql_result($r esult,0);
$len = strlen($data);
$type = getImage($data) ;
header("Content-type: $type");
header("Content-length: $len");
echo $data;
?>
===SNIP END===

NOTE: Loading images from a dB is really lame! I tried this (as above
code shows) and while it does work, it is extreamly slow and taxing on
your server unessecarly. I would suggest have a directory called
"images" and having a list of that directory in the database, that
would be much faster!

Example:
===SNIP START===
<img src="getImage.p hp?image=1">
<?php //this is are fake "getImage.p hp" file ;)
require_once('p athtodatabasefi le.php');
function getImage($data) {
if(substr($data , 0, 3) == "GIF") return "gif";
if(substr($data , 0, 2) == "BM") return "bitmap";
if(substr($data , 6, 4) == "JFIF") return "jpeg";
if(substr($data , 1, 3) == "PNG") return "png";
if(substr($data , 0, 2) == "II" || substr($data, 0, 2) == "MM") return
"tiff";
return 1;
}
$query="SELECT name from $database.image table WHERE value =
".$_GET['image'].";";
$name = mysql_result(my sql_query($quer y),0);
$buf=readfile(" ./images/$name");
$len=strlen($bu f);
$type=getImage( $buf);
header("Content-type: $type");
header("Content-length: $len");
echo $buf;
===SNIP END===

Wow, hope you can digest all that!

Cheers,
hackajar (at not spam, please don't spam) gmail (PLEASE NO SPAM) com
eholz1 wrote:
Hello Members,

I am setting up a photo website. I have decided to use PHP and MySQL.
I can load jpeg files into the table (medium blob, or even longtext)
and get the image(s) to display without a problem. I am using
chunk_split(dat a) and the base64_encode and base64_decode on the files.

I do a select from the database, and then echo the image (with
header(Content Type: image/jpeg)
and the decoded image displays fine. Yes, I have tried header(Content
Type: image/png), without
success.

My problem is png images. Is there something that I need to do
different in terms on reading/encodeing/decodeing the png image? I am
putting its "binary" data into the db table.
But when I do a select on a png image - it never displays in the
browser.

I am not using file/path names as references, but actually putting the
image in the db.

Here is a sample of code I use to insert the data into the table, and
to select the code from the table.

load image(s):
<?php
while ($file = readdir($dir_ha ndle))
{
$filetyp = substr($file, -3);
if ($filetyp == 'png' OR $filetyp == 'jpg')
{
$handle = fopen($path . "/" . $file,'r');
$file_content = fread($handle,f ilesize($path . "/" . $file));
fclose($handle) ;

$encoded = chunk_split(bas e64_encode($fil e_content));
$sql = "INSERT INTO images SET sixfourdata='$e ncoded'";
mysql_query($sq l);
}
}
?>

display images:

<?php
$result = @mysql_query("S ELECT * FROM images WHERE id=" . $img . "");

if (!$result)
{
echo("Error performing query: " . mysql_error() . "");
exit();
}

while ( $row = mysql_fetch_arr ay($result) )
{
$imgid = $row["id"];
$encodeddata = $row["sixfourdat a"];
}
?>

<?php
//echo base64_decode($ encodeddata);
echo $encodeddata;
?>

This process seems to always work with jpegs.

Thanks

ewholz
Dec 26 '06 #10

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

Similar topics

3
3498
by: Srdjan Pejic | last post by:
Hello, I have a problem that I have not been able to solve, even after searching the web. I have stored couple of images in the MySQL database and I am trying to get them displayed on a web page with PHP. Now, before we go any further, I want to make it clear that I am very aware of the current debate about storing images in the database. I understand both sides, however this is something I want to do for fun, as well as good learning.
2
1811
by: gsb | last post by:
Not sure is best place to ask, but... What should the mySQL table look like to save and extract a series of images. I want to "insert" an image by name (string) and later "select" and send it to a web page. Thanks, gsb
15
2327
by: Geoff Cox | last post by:
Hello I have following type of code in the header function pre_load_pics() { if (document.images) { var image1 = new Image(400,265); image1.scr = "pic1.jpg";
9
2792
by: Dejan | last post by:
Hy, Sorry for my terreble english I have this simple code for deleting rows in mysql table... Everything works fine with it. So, what do i wanna do...: my sql table looks something like this: id Name Surname pictr0 picrt1 pictr2 pictr3
11
3803
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result = mysql_query("select * from $tableInfo") ; for ($i = 0; $i < mysql_num_rows($result); $i++) {
5
6843
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a huge performance hit when I load the target table with "Not Null" constraints as compared to loading a target table without the constraints.
1
1781
osward
by: osward | last post by:
Hi all, I got code over the net for paging mysql table, it provides Prev pages Next link at the bottom of the table. However, I have a pretty large table to display (average over 400+ rows). Even when I limited the rows to display 30, It still have over 10 page link display between Prev and Next link. Following are code to display the links echo "<center>"; // Build First & Previous page Link if($page > 1){ $prev = ($page -...
3
7402
by: printline | last post by:
Hello All I need a little help with a phph script to display some specific data from a mysql table. I have a mysql table with 4 columns and 10 rows. I want to display fx. data from row 4, 6, 8 and 10. I can display either the first row or all the rows using the below code: $row = mysql_fetch_array($result) or die(mysql_error()); echo $row. " - ". $row. " <img src=images/arlon.jpg /> ". $row. " - ". $row;
4
9093
by: Peter910 | last post by:
Brothers in the house. I plan developing an online database application with PHP and MYSQL. In my database design structure, I plan to have maximum of 50 columns and maximum of 20,000 rows in a certain table. But then I will to like have the experience of the members in the house. What exactly is the maximum number of rows and columns in a MYSQL database table. I will be glad to receive if there is any other restriction(s)/limit(s)...
0
8538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8797
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8800
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4323
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2237
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.