English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi

I run the following:

// get page results
$sql = "SELECT timestamp1,title,author,substring(body,100) FROM test.articles

ORDER BY timestamp1 desc
LIMIT $startindex, $perpage";

.. etc:

print "

";
print $row->body;
print "
";
print "

";

i get error:
PHP Notice: Undefined property: stdClass::$body in C:\Inetpub.....

the column type for body is test, i read here that substr doesnt work with longtext:
http://bugs.mysql.com/bug.php?id=15757

so i also tried left(body,50), doesn't work!



thanks in advance

aurevoir

Tovia

2007-10-19 20:06:51 · 2 answers · asked by jam 5 in Computers & Internet Programming & Design

2 answers

Your sample code is incomplete to find where your mistake is.
- It seems to me that you may have forgotten to fecth! i.e.
$list = mysql_query($sql) or die("Query failed : " . mysql_error());
while ($lst = mysql_fetch_array($list)) ...
- The type "test" is mysql does not exist, so I assume it is "longtext" or "varchar"
- "Undefined property" seems to say that "body" is not part of the table structure...
Send me the whole code zipped. Include the table structure.
I'll have a look.
(Pas assez de détails pour répondre correctement)

2007-10-19 21:06:02 · answer #1 · answered by just "JR" 7 · 1 0

replace this code after mysql_select_db("mydatabase") or die(); $question = mysql_query(" pick remark FROM remark") or die(mysql_error()); if (mysql_num_rows($question) > 0 ) { mutually as ($row = mysql_fetch_array($question)) { extract ($row); return $call; } } ?> savor!!

2016-10-13 06:30:12 · answer #2 · answered by thorton 4 · 0 0

fedest.com, questions and answers