fazzfarrell Posted December 8, 2008 Share Posted December 8, 2008 I am currently creating a dating website - One problem I can't work is that the user is only allowed to upload 10 pictures. I want to be able to allow them to upload 10 pics only how do I go on about doing this? Link to comment https://forums.phpfreaks.com/topic/136052-10-uploads/ Share on other sites More sharing options...
JonnoTheDev Posted December 8, 2008 Share Posted December 8, 2008 Run a count on the number of image records for that user in the database. If it equals 10 then dont display the upload field. Link to comment https://forums.phpfreaks.com/topic/136052-10-uploads/#findComment-709360 Share on other sites More sharing options...
redarrow Posted December 8, 2008 Share Posted December 8, 2008 There are meny ways mate.... Add a field example number_of_pic were the picture names are in that row now each time a user enter a picture you need to let the database no and increment the number... <?php $sql="update picture set number_of_pic=number_of_pic+1 where user_id='$user_id'"; ?> every time the user uplaods a pic the new database field get added a 1 to it.. then do this <?php $sql="select * from picture where user_id='$user_id'"; $res=mysql_query($sql)or die(mysql_error()); while($data=mysql_fetch_assoc($res)){ if($data['number_of_pic'])==10)){ echo "To meny pictures!"; } } ?> Link to comment https://forums.phpfreaks.com/topic/136052-10-uploads/#findComment-709365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.