Jump to content

Limiting max charictors returned in an sql query


Fallen_angel

Recommended Posts

Hi I need a bit of help with a script I have

I what I basicly want to do is have a short decription pulled from one of my database fields
the database field itself can have 10,000 charictors in it , however I only want to return 250 charictors so that it can be used as a description in the bellow search script
[code]
<?php
//Connect To database
include "connect.php";
$id = $_GET['id'];
//collects Data
$data=mysql_query(" SELECT * FROM strains where s_breeder='$id' ")
or die(mysql_error());
Print "<table class='print_list_alpha' border=0px style=border-bottom:1px;>" ;
while ($info= mysql_fetch_array($data) )
{
Print "<tr><td><img src=./uploads/mini_thumbs/".$info['img']."></td><td><table><tr><td><a href=../guide/report.php?id=".$info['s_id']."><b>".$info['s_name']."</b></a></td><tr><td> ".$info['s_notes'] ."</td></tr></table>";
}
Print "</table>" ;
?>[/code]

Thanx to anyone that can help

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.