473,320 Members | 2,193 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.

Why won't Longtext data type display?

damir
14
I have a problem with reading data from database. Everything displays correctly except the 'Message' row which doesn't show up at all.

Problem is in the longtext data type. If I change it to mediumtext (or text) it works. Below is a table conf and a query.

ID mediumint(8)
Type tinyint(1)
Title varchar(100)
DateCreated datetime
DateModified datetime
Sender char(10)
Recipients varchar(800)
ReadBy varchar(800)
Message longtext

Expand|Select|Wrap|Line Numbers
  1. SELECT ID, Type, Title, DateCreated, DateModified, Sender, Recipients, ReadBy, Message
  2. FROM G1_Messages
  3. WHERE ID=?
I'm using the newest MAMP if it helps, and I have already changed php.ini memory limit to 64M, 128M, 256M and even 512M and nothing helps.
Feb 16 '11 #1
2 2349
code green
1,726 Expert 1GB
Where is the problem occurring,
reading the DB, returning the data, processing the data or output?
You also haven't described how or where display is.
Put some debugging code to find where the problem is
Feb 17 '11 #2
damir
14
Expand|Select|Wrap|Line Numbers
  1. class Message
  2. {
  3.    private $message = array();
  4.    private $exists;
  5.  
  6.    public function __construct($db, $id)
  7.    {
  8.       // expends memory location
  9.       ini_set('memory_limit', '64M');
  10.  
  11.       $query = 'SELECT ID, Type, Locked, Title, DateCreated, DateModified, Sender, Recipients, ReadBy, Message
  12.                 FROM ' . Session::Get('GROUP') . '_Messages
  13.                 WHERE ID=?';
  14.  
  15.       $stmt = $db->prepare($query);
  16.       $stmt->bind_param('i', $id);
  17.       $stmt->execute();
  18.  
  19.       $stmt->store_result();
  20.       $this->exists = $stmt->affected_rows;
  21.  
  22.       if ($this->exists > 0)
  23.          $this->message = fAssoc($stmt);
  24.  
  25.       $stmt->close();
  26.    }
  27.  
  28.    public function Exist()
  29.    {
  30.       return ($this->exists == 0) ? false : true;
  31.    }
  32.  
  33.    public function Get($argument)
  34.    {
  35.       return $this->message[$argument];
  36.    }
  37. }
Expand|Select|Wrap|Line Numbers
  1. function fAssoc($stmt)
  2. {
  3.    // creates associative array for the bind_result function
  4.    $meta = $stmt->result_metadata();
  5.    $parameters = array();
  6.    $result = array ();
  7.  
  8.    while ($field = $meta->fetch_field())
  9.       $parameters[] = &$row[$field->name];
  10.  
  11.    call_user_func_array(array($stmt, 'bind_result'), $parameters);
  12.  
  13.    while ($stmt->fetch())
  14.    {
  15.       foreach ($row as $key => $value)
  16.          $result[$key] = $value;
  17.    }
  18.  
  19.    return $result;
  20. }
Feb 17 '11 #3

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

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
1
by: deko | last post by:
Okay, so I figured out how to pull Outlook Appointments into an Access Table (see below). But the data comes in the wrong Data Type - how do I convert it from Text to Long Integer? For...
13
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify...
3
by: Bob Day | last post by:
VS 2003, sql How do you determine the data type of a column if its value is DBNull? 1)Table: Column1 STRING non-nullable 2) Fill to a DataSet via DataAdapter 3) dim Data_Type_Is...
4
by: serge | last post by:
I was working on figuring out where a certain application was storing the multiple selection choices I was doing through the app. I finally figured out that they were being store in an IMAGE data...
9
by: jc | last post by:
Hi all, I have a data type to use that I can't modify its codes. E.g. This template data type is data_type. When I declare a variable of this data_type, I write as following: data_type(8,...
8
by: mlwerth | last post by:
Dear Access Group: This is the most basic and most embarrassing of questions, but I cannot find where to change the data type of a text field that I have in Access 2003 to a number field. I've...
1
by: npm | last post by:
I'm trying to find out why the android browser won't load and/or display my XML data. This javascript works fine on computer browsers (FF, IE, Safari, Chrome, Opera) and even in iPhone's Safari, but...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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

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.