colap
-
Posts
302 -
Joined
-
Last visited
Posts posted by colap
-
-
I tried this:
$listyear = array(); for($i=2010;$i<=2020;$i++){ array_push($listyear,array($i => $i)); }
Array ( [0] => Array ( [2010] => 2010 ) [1] => Array ( [2011] => 2011 ) [2] => Array ( [2012] => 2012 ) [3] => Array ( [2013] => 2013 ) [4] => Array ( [2014] => 2014 ) [5] => Array ( [2015] => 2015 ) [6] => Array ( [2016] => 2016 ) [7] => Array ( [2017] => 2017 ) [8] => Array ( [2018] => 2018 ) [9] => Array ( [2019] => 2019 ) [10] => Array ( [2020] => 2020 ) )
But i want in this format :
Array( [2010] = 2010 [2011] = 2011 ........ )
-
When i start a topic/thread or reply for a post i get and option "Notify me of replies" at bottom of the form as a checkbox.
Is this for email notification of forum notification ?
That's confusing.
Forum notification is >Profile>Modify Profile>Notification.
-
Thinking all of cases which is better?
-
Which is better to use echo 'Hello world' or echo "Hello world" ?
-
I'm notified when someone replies to my thread.
How can i stop this.
But i want to keep getting notification here in phpfreaks forum when i log in phpfreaks forum,but not in my personal mail.
-
Which is valid/better data type for date in postgresql table?
Is it date or datetime ?
create table dd ( id serial primary key, title varchar(50) not null, created_at date);
-
mysql> describe acos; +-------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | parent_id | int(10) | YES | | NULL | | | model | varchar(255) | YES | | NULL | | | foreign_key | int(10) | YES | | NULL | | | alias | varchar(255) | YES | | NULL | | | lft | int(10) | YES | | NULL | | | rght | int(10) | YES | | NULL | | +-------------+--------------+------+-----+---------+----------------+ 7 rows in set (0.00 sec) mysql> describe aros; +-------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | parent_id | int(10) | YES | | NULL | | | model | varchar(255) | YES | | NULL | | | foreign_key | int(10) | YES | | NULL | | | alias | varchar(255) | YES | | NULL | | | lft | int(10) | YES | | NULL | | | rght | int(10) | YES | | NULL | | +-------------+--------------+------+-----+---------+----------------+ 7 rows in set (0.00 sec) mysql> describe aros_acos; +---------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+------------+------+-----+---------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | aro_id | int(10) | NO | MUL | NULL | | | aco_id | int(10) | NO | | NULL | | | _create | varchar(2) | NO | | 0 | | | _read | varchar(2) | NO | | 0 | | | _update | varchar(2) | NO | | 0 | | | _delete | varchar(2) | NO | | 0 | | +---------+------------+------+-----+---------+----------------+ 7 rows in set (0.00 sec)
How are acos,aros table created?
Why are the table structures like that?
mysql> select * from aros; +----+-----------+-------+-------------+-------+------+------+ | id | parent_id | model | foreign_key | alias | lft | rght | +----+-----------+-------+-------------+-------+------+------+ | 1 | NULL | Group | 1 | NULL | 1 | 2 | | 2 | NULL | Group | 2 | NULL | 3 | 4 | | 3 | NULL | Group | 3 | NULL | 5 | 6 | | 4 | NULL | Group | 4 | NULL | 7 | 8 | | 5 | NULL | Group | 5 | NULL | 9 | 10 | | 6 | NULL | Group | 6 | NULL | 11 | 12 | | 7 | NULL | Group | 7 | NULL | 13 | 14 | | 8 | NULL | Group | 8 | NULL | 15 | 16 | | 9 | NULL | Group | 9 | NULL | 17 | 18 | | 10 | NULL | Group | 10 | NULL | 19 | 22 | | 11 | NULL | Group | 11 | NULL | 23 | 24 | | 12 | NULL | Group | 12 | NULL | 25 | 28 | | 13 | NULL | Group | 13 | NULL | 29 | 30 | | 14 | NULL | User | 1 | NULL | 31 | 32 | | 15 | NULL | User | 2 | NULL | 33 | 34 | | 16 | NULL | User | 3 | NULL | 35 | 36 | | 17 | 12 | User | 4 | NULL | 26 | 27 | | 18 | 10 | User | 5 | NULL | 20 | 21 | +----+-----------+-------+-------------+-------+------+------+ 18 rows in set (0.02 sec) mysql> select * from acos; +----+-----------+-------+-------------+-------------+------+------+ | id | parent_id | model | foreign_key | alias | lft | rght | +----+-----------+-------+-------------+-------------+------+------+ | 1 | NULL | NULL | NULL | controllers | 1 | 2 | +----+-----------+-------+-------------+-------------+------+------+ 1 row in set (0.00 sec) mysql> select * from aros_acos; Empty set (0.00 sec)
Can someone please explain how it works?
I can setup user authentication and after successfull authentication it will allow/deny some actions for controllers.
So why do we need acl? And when is acl needed/must?
Can't understand the concept of acl.
I have read the article from cakephp book.
-
What exactly is the $xmldoc object?
$xmldoc= domxml_new_doc("1.0");
-
$this->val = $xmldoc->dump_mem(true, "ISO-8859-1");
What's the equivalent function of dump_mem in php5?
-
var_dump($obj);
object(php4DOMDocument)#289 (2) { ["myDOMNode"]=> object(DOMDocument)#295 (0) { } ["myOwnerDocument"]=> *RECURSION* } Search Again
How can i get the value inside of this Dom object ?
-
Is it possible to access php 4 class member function or variable with a dot(.) ?
Is arrow(->) for php5 syntax ?
-
Doing print_r($val);
I get
php4DOMDocument Object ( [myDOMNode] => DOMDocument Object ( ) [myOwnerDocument] => php4DOMDocument Object *RECURSION* )
Is it possible to get the value of this object?
I used this script. http://alexandre.alapetite.fr/doc-alex/domxml-php4-php5/index.en.html
-
I am still really new to php aswell, but maybe a loop
so if $loop <= 2 do random code?
Put all random number in array.
Check if a number is there twice before storing into database.
-
The second &, obj=& new classname();.
Is that php-4 syntax?
-
function &getInstance($boot = true) { static $instance = array(); if (!$instance) { if (!class_exists('Set')) { require LIBS . 'set.php'; } $instance[0] =& new Configure(); $instance[0]->__loadBootstrap($boot); } return $instance[0]; }
Why is & there? function &getInstance
And is it php4 syntax using the & ?$instance[0] =& new Configure();
-
Is there any debug function ?
-
Hi,
Is there any debug($val); command available for php code?
How can i add a breakpoint in php code and do Next> to go for the next line like some C++ IDE?
Is it possible with php code?
Thanks.
-
-
Just define $bmi at the top of your page:
$bmi = '';
An undefined variable is a variable that you are trying to use but hasn't been given a value.
Why is it necessary to define $bmi="" ; at top?
-
when user logs in they get $this_session = session_id();
When they log out I do : session_destroy();
But when they log back in, the session_id() value is the same as the previous log-in!
How do I reset this to be unique, and why doesn't session destroy do that?
More: http://php.net/manual/en/function.session-regenerate-id.php
-
why does my mysql_num_rows always give the same err
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp2\www\e_commerce\e_commerce\admin\viewProducts.php on line 8
$conn= mysql_connect("localhost","root",""); mysql_select_db("ecommerce",$conn); $product_list=""; $sql = "SELECT * FORM products"; $query = mysql_query($sql,$conn); $exist = mysql_num_rows($query);
although the very same code is running fine in another file of the same project.
Please help me.
So what was the error ?
-
Ok I'm having an issue with a simple PHP Inlcude that I've never ran in to before. Maybe you guys can help.
I'm trying to include a picture simply titled 'promo1.jpg'.. I go about the normal PHP include way with this code:
<?php include $_SERVER['DOCUMENT_ROOT'] . '/images/promo1.jpg'; ?>
This proceeds to only output a question mark '?'. No error message. Nothing else. Just the server saying "What the hell?". I've tried not doing the DOCUMENT_ROOT route and tried more locally but still same '?'. Any ideas on this one? Any help is appreciated, thanks.
You can't include an image.
You have to echo image inside a html image tag.
That was simple.
-
@galvan,
Post your code in "
..
" tag.
-
Can you give some hint?
Zend Framework error, array to string conversion , implode
in Frameworks
Posted
If i click the login link i get error =>
Can anyone tell why am i getting this error?
And how can i solve it ?
Login form =>