[PHP] Best practice for creating mysql database structure for menus navigation

2004-04-19 Thread dr. zoidberg
Hello,

What will be the best database structure for creating web site 
navigation, menus with submenus (unlimited levels).

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: question about M. Lemos's HTML forms generation and validation

2004-03-26 Thread dr. zoidberg
Manuel Lemos wrote:
Hello,

On 03/25/2004 10:19 PM, Dr. Zoidberg wrote:

I'm creating registration service with this great form script for 
creating forms within Smarty.

Question is how can I validate 'username' against allready registered 
users in MySQL so that someone cannot register him self if there is 
another user with that username.


You can always use the ValidateServerFunction parameter to specify the 
name of a callback function that will make a database query to see if 
ise there any user name with the value passed to that function. If there 
is a record with that user name return 0 and the class will set the 
respective input field as invalid.
I'm trying to create that for a few hours. Can you PLS give me an example?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] question about M. Lemos's HTML forms generation and validation

2004-03-25 Thread dr. zoidberg
Hello,

I'm creating registration service with this great form script for 
creating forms within Smarty.

Question is how can I validate 'username' against allready registered 
users in MySQL so that someone cannot register him self if there is 
another user with that username.

TNX!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Optimise two mysql queries to one query

2004-03-16 Thread dr. zoidberg
Hello,

$a = mysql_query(Select a,b FROM t WHERE category=1)
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query(Select * FROM t WHERE subcategory=$x)
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.

TNX

--
Please do not CC me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] High bandwidth application tips

2003-11-09 Thread dr. zoidberg
Radu Manole wrote:

Hi all,

I do have a question about optimizing the php for large applications.
Many applications group the functions in files (eg. functions.inc.php) or
build classes, and these files/classes are called with 'require' or
'include' on the top of each main file.
What would be the speed penalty if we have to include many files or if these
functions containter files are over 100k in size. I know the php engine will
parse them too. Are any tips to follow when using many functions?
It is much better to include only one big file, but only if you need all 
of that functions. You should try to separate your functions into 3 or + 
files: LoginFunctions.php, OtherFunctions.php, PictureFunctions.php and 
include only the ONE you need. If you need all of them, make only one 
file, and include only one file.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How Can I read this Array

2003-11-08 Thread dr. zoidberg
Hello,

how can I read element1, element2 and element3 from array:

a|a:1:{i:1;a:3:{
i:0;s:6:element1;
i:1;s:5:element2;
i:2;s:6:element3;
}}
TNX

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php