Results 1 to 6 of 6
Related
-
Fade-effect Forum: Javascript Forum
Replies: 0 -
=== type comparison in mysql? Forum: Databases
Replies: 6 -
Cool effect. How did they do it? Forum: Javascript Forum
Replies: 1 -
Upgrading forums Forum: CGI Perl Forum
Replies: 8 -
Rollover Effect Forum: HTML Forum
Replies: 12
-
01-17-2006, 05:33 AM #1
upgrading MySQL column type has no effect
I've created a web page in .php which receives it's content from a MySQL database, it is all working nicely and looking good except that a field which I have called Ed_Main is now about 65kb and now does not display all the text stored in it.
I'm using PHPMyadmin to administer MySQL.
MySQL version 4.0 (CGI setup)
MySQL installed on local machine (high-end Pentium laptop)
IIS installed on local machine
OS - XP Pro SP2
Browser: IE6
I was creating my content in an external application then I 'Browsed' in PHPMyadmin for the relevant record and pasted it into the field in PHPMyadmin directly. I did it this way as I've not yet created any input pages for updating the web site.
The field in PHPMyadmin seems to accept my entire text and when I navigate back to that field again after saving the record, indeed, the text was saved. So I then check my .php page to view the out put and find that my content has been truncated. It seems to make no difference whether I add more text, it still truncates in the same place, so I assume it is a size issue (although, isn't it odd that my ENTIRE text seems to be stored ok in the database, since I've been back via PHPMyadmin to look at it!)
Anyway, I then changed the field type using PHPMyadmin from 'Text' to 'MediumText' and saved my changes. The situation is still identical, although PHPMyadmin indicates that the change was successful. I have also run the repair option on the database with no improvement.
As I said, my text is currently about 65kb (although I need to add about another 40kb to it), so the MediumText field which holds about 16mb, should have no bother holding it.
Does anyone know the answer to this? I spent the entire day searching online and can find nothing of any help!
Thanks
peter
-
01-20-2006, 09:36 PM #2
Re: upgrading MySQL column type has no effect
If you're sure the entire text is being stored in your MySQL database, then your problem could be with your PHP page instead. Post the rendered code for the page in question. Maybe there's something in the page that can be fixed to cure this problem.
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
-
01-22-2006, 08:25 PM #3
Re: upgrading MySQL column type has no effect
Originally Posted by vinyl-junkie
HTML Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <? $item=$_GET['item']; $username="*******"; $password="******"; $database="********"; /* Connecting to a database and retrieve data */ $conn=odbc_connect($database,$username,$password); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * FROM products WHERE ProdID='1'"; $rs=odbc_exec($conn,$sql); $Ed_Main=odbc_result($rs,"Ed_Main"); echo "ed_main is ". strlen($Ed_Main)." characters long"; $rs=odbc_exec($conn,$sql); $Ed_Main=odbc_result($rs,"Ed_Main"); echo "<br>$Ed_Main"; odbc_close($conn); ?> </body> </html>
For enhanced night time viewing, pressing the backlight key illuminates the LCD display and keypad, and if no other keys are operator.</p>
<p></p>
<div style='font-size:1.0em; color:darkgreen;'><b><i>Versatility...
password removedLast edited by HTML; 01-22-2006 at 08:38 PM. Reason: private information removed
-
01-23-2006, 08:53 PM #4
Re: upgrading MySQL column type has no effect
When I said to let us know what the rendered page looked like, I meant what it would look like when you did a View Source from your browser.
How is your database table defined? (You can find this information in phpMyAdmin, or whatever product you use to browse the database from your web hosting account.) I've been looking at the field definition information in the manual and I don't see any definition that would limit the characters in a field to 4095. That's why I was thinking that perhaps you had something in your HTML that was causing the problem.
I'm grasping at straws because I have no idea what the problem could be.Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
-
01-24-2006, 12:32 AM #5
Re: upgrading MySQL column type has no effect
Originally Posted by vinyl-junkie
I've had a break through this morning! I have changed my connection method to mysql_connect from odbc_connect and that seems to have completely fixed it!
I don't think I'll be using odbc again unless I have to!
Thanks for all you help and patience with me.
Kind regards
pete
-
02-23-2006, 10:50 AM #6
Re: upgrading MySQL column type has no effect
Although you have fixed it, it would be helpful for anyone reading this thread to know why that worked.
I don't know the answer, but it is significant that the text stopped on character 4095 = i.e. the truncation is 4096 (with a 0 start) characters in length which is 2^12.
This makes it appear to be a limitation of either the variable you read it in to, or the function you used to read it.
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum