Search found 9 matches

by forgodsake8
Mon Apr 19, 2004 5:46 pm
Forum: PHP - Code
Topic: converting DATE to a more readable format
Replies: 4
Views: 306

Hi, the query im using on page, returns * from certain tables: select * from ts_module_books inner join advert2 on advert2.mod_book_id = ts_module_books.id where ts_module_books.book_title LIKE '%$search%'"); is there another way of doing the date function besides the way you showed above? Cheers
by forgodsake8
Mon Apr 19, 2004 4:00 pm
Forum: PHP - Code
Topic: converting DATE to a more readable format
Replies: 4
Views: 306

Hi, I'm not sure how im meant to use the select unix_timestamp(thedatefield) from table on my page? do I use it on the php page or in the database??? I have already inserted a date for each field, using 'now', so everytime something is inserted into the database the date it was entered is also saved...
by forgodsake8
Mon Apr 19, 2004 3:28 pm
Forum: PHP - Code
Topic: converting DATE to a more readable format
Replies: 4
Views: 306

converting DATE to a more readable format

Hi, ive got a field called date that is automatically inserted into my table.
When i output the contents I get this

2004-04-19 18:59:55.465774

How do I get this into a friendlier format, for example

Tuesday 19th April 6.59pm

any ideas???
Thanks

lou
by forgodsake8
Mon Apr 19, 2004 3:23 pm
Forum: Databases
Topic: alter column type
Replies: 2
Views: 264

Column | Type | Modifiers --------------+-----------------------------+---------------------------------------------------------------- advert_id | integer | not null default nextval('public.advert2_advert_id_seq'::text) username | character varying | mod_book_id | character varying | asking_price |...
by forgodsake8
Mon Apr 19, 2004 1:34 pm
Forum: Databases
Topic: alter column type
Replies: 2
Views: 264

alter column type

Hi,
Is it possible to alter the type of a column in a table?
For example changing an INT to a VARCHAR.
How would I do this using PostgreSQL.
Thanks.

Lou
by forgodsake8
Tue Apr 06, 2004 6:29 pm
Forum: Databases
Topic: sql query help
Replies: 3
Views: 458

The problem is that I want to return ALL the fields from ts_module_books,
where the $search term is in ts_module_books.book_title and also appears in advert2.
As well as this, I want it to return the username from the advert2 table.

If this makes sense!

any ideas?

Lou
by forgodsake8
Tue Apr 06, 2004 5:33 pm
Forum: Databases
Topic: sql query help
Replies: 3
Views: 458

sql query help

Hi, I'm trying to write a query that when a user enters a search term in a text box such as Computing, it will then check whether there are any adverts available with Computing in their title. The tables are: advert2 (advert_id, username, mod_book_id, asking_price, condition, description, date_added...
by forgodsake8
Tue Mar 16, 2004 7:48 am
Forum: Databases
Topic: inserting table into postgres
Replies: 1
Views: 372

inserting table into postgres

Hi, I'm trying to insert some tables into a postgres database, but i seem to be having some problems. I've inserted a table called advert, which is laid out as follows: advert_id - (PK) username mod_book_id (this links to the another table called module_books on the tables primary key called "i...
by forgodsake8
Fri Feb 27, 2004 8:30 pm
Forum: Databases
Topic: PROBLEM can retrieve data but not insert data?!!
Replies: 1
Views: 326

PROBLEM can retrieve data but not insert data?!!

Hi, I'm new to PHP, and am having MASSIVE problems trying to insert data into my mysql tables. The tables and code im using has been provided by an online tutorial, and I'm using SQL Yog to view my tables - to see if data has been added to them. The code has been checked by a friend on another compu...