![]() |
Alexey admin 10/5/2007 |
Hi, {if $user_has_no_records}...{/if} Then use List page: Before Displayevent to check if user already added a record. global $conn; $sql = "select count(*) from TableName where userid=..."; $rscount=db_query($sql,$conn); $datacount=db_fetch_numarray($rscount); if($datacount[0]) $smarty->assign("user_has_no_records",false); else $smarty->assign("user_has_no_records",true);
global $conn; $sql = "select count(*) from TableName where userid=..."; $rscount=db_query($sql,$conn); $datacount=db_fetch_numarray($rscount); if($datacount[0]) return false; else return true; |
L
|
luck author 10/11/2007 |
Hi Alexey, |
![]() |
Alexey admin 10/11/2007 |
Try using this code: $sql = "select count(*) from TableName where userid=".$_SESSION["_TableName_OwnerID"]; |
J
|
jetacera 9/16/2008 |
I'm using this code for a photo section using the members template, phpr version 4.2, and a mysql database. |
J
|
Jane 9/16/2008 |
Hi, |
J
|
jetacera 9/16/2008 |
Never mind, now it works. I was expecting the Add page to show the message before they tried to add the 16th image, but it shows when the user clicks the Save button, so I'm good to go. (my code worked fine for anyone else that needs to use it) |