Forums

PHP

This topic is locked

Auto populate if empty

Posted 30 Apr 2004 20:09:17
1
has voted
30 Apr 2004 20:09:17 Mark Wells posted:
I am using Pure PHP Upload to allow users to put a photo on their listings. What I want to be able to do is have no_photo.jpg automatically entered into the database in the user does not select a photo of their own. I have this file on the server already. Any input would be appreciated.

Thanks,
Mark

Replies

Replied 01 May 2004 13:03:04
01 May 2004 13:03:04 Vince Baker replied:
are you using access? if so, you can make a default value in a text field.

there are code methods but your best option is to have a default value in your db.

If you want the coded version, post back and I will give you some dummy code you can use.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 17 May 2004 23:20:53
17 May 2004 23:20:53 Mark Wells replied:
Bakerv,

Using PHP with a MySQL database. I have the database setup so the default is no_photo.jpg if null & I have the column set to VARCHAR, but this is not working. Any ideas?

Thanks,
Mark


Edited by - CyberGarage on 17 May 2004 23:45:21
Replied 18 May 2004 09:34:42
18 May 2004 09:34:42 Vince Baker replied:
When you say not working, do you mean that the db does not automatically insert the default value or is it being inserted but the image is not being displayed on the page?

Regards
Vince

DMX Talkzone Manager

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 18 May 2004 14:20:19
18 May 2004 14:20:19 Mark Wells replied:
Bakerv,

The default value isn't being populated by the database. I can manually edit the database record after the listing has been inserted and it works fine but it won't do it by default.

Thanks,
Mark
Replied 19 May 2004 02:15:20
19 May 2004 02:15:20 Dean Blackborough replied:
Your Insert Record Server behaviour may be entering a null value, change it to Value: None, the db default will then be applied.

-------------------------------
www.galleryof3d.com
(PHP and MySQL)

Edited by - G3D on 19 May 2004 02:16:38

Reply to this topic