Web Hosting Talk







View Full Version : PHP/mySQL call function help


VanHost
02-26-2004, 01:55 AM
I have a table with 3 columns (A, B, C). What is the best way to have a single web page display everything in Column B? I would like it seperated by (if possible) a line, or an image of a line.

Ie.


Column B - Row 1

-------------------------------------------------------------

Column B - Row 2

-------------------------------------------------------------

Column B - Row 3

-------------------------------------------------------------

Column B - Row 4


and so forth. Any help is always appreciated.

VanHost
02-26-2004, 01:59 AM
Also, if I only wanted to display a max of (say) 256 characters of an entry, is this possible? Can someone point me in the direction of this? :)

luki
02-26-2004, 02:46 AM
Using SQL as follows:

SELECT LEFT(column_b, 256) AS b FROM table;

That will give you column_b of all rows in the table, and only the first 256 characters of the entry.

I'll leave it up to you to run the query and fetch the results and display. How it's done depends on the language you want to use.