Jump to content

colap

Members
  • Posts

    302
  • Joined

  • Last visited

Everything posted by colap

  1. insert into tablename(col1,col2) values("a","b"); I got this error: Field 'id' doesn't have a default value. id is the auto_increment primary key column.
  2. It's a mysql table. The first column is int(11) auto_increment not null primary key, I want to insert data into that table without specifying the first column name. What would be the sql query? The firs column is col1 with auto_increment.The value for the first column would be automatically inserted.Is it? insert into tablename(col2,col3) values("a","b");
  3. How can i add combobox in zend framework form? Is there anything like that ? $catagory=new Zend_Form_Element_Combobox;
  4. How can i upload image and .flv or .swf file with zend framework? Can anyone post complete code to create form and to upload image and video file? Which function to use for upload? Is it? $obj=new Zend_Transfer_Adapter_Http(); $obj->receive();
  5. Is it for only me? I can't post anything without the approval of moderator.
  6. Can anyone post a generic update function to update mysql table. The manual approach: update $tablename set $column1='a', $column2='b' where $id=$value;
  7. I get this message: Note: This message is awaiting approval by a moderator.
  8. colap

    Joins

    Does this help? http://colalinux.blogspot.com/2010/11/sql-tutorial.html
  9. How can i use single quote for values? $qry='insert into tablename values('a','b');';
  10. It's about making a form for a web page. Which is better? Using table or divs? Which do you use? <form action='a.php' method='post'> <table> ............. </table> </form> <form action='a.php' method='post'> <div> ............. </div> </form>
  11. Done. <?php class Forall{ public $var_a=100; function process(){ echo 'This is for testing'.'<br>'; echo '$var_a: '.$this->var_a.'<br>'; } } $obj=new Forall(); $obj->process(); ?> <form action='post' method='insvideo.php'> videotitle: <input type='text' name='nm_videotitle'/><br> description: <input type='text' name='nm_description' /><br> createddate: <input type='text' name='nm_createddate' /><br> image: <input type='text' name='nm_image' /><br> <input type='submit' /> </form>
  12. test.php: <?php class Forall{ public $var_a=100; function process(){ echo 'This is for testing'.'<br>'; echo '$var_a: '.$this->var_a.'<br>'; } } $obj=new Forall(); $obj->process(); <form action='post' method='insvideo.php'> videotitle: <input type='text' name='nm_videotitle'/><br> description: <input type='text' name='nm_description' /><br> createddate: <input type='text' name='nm_createddate' /><br> image: <input type='text' name='nm_image' /><br> <input type='submit' /> </form> ?> error: How can i know the line number for error?
  13. In c++ class we can declare function inside a class and then we can describe that function at bottom. Can i do this in PHP class? In C++ class: class Myclass{ void doall(); } void Myclass::doall(){ ............. ............. }
  14. header("Location: filename.html"); In filename.html echo $_SESSION['first_name'];
  15. yep, the field is set as DATE, and i used NOW() , but this is still inserting as 0000-00-00 arrrghhh http://colalinux.blogspot.com/2011/02/insert-date-into-mysql-table.html
  16. Could not understand. Are you suggesting about developing Forums?
  17. What type of project that can be. It won't be a pesonal website. It would be a database oriented website.
  18. Can't echo newline. <?php class Myclass{ public $var_one=100; public $var_two=400; function printvalues(){ echo 'Inside printvalues function\n'; echo '$var_one: '.$this->var_one.'\n'; } } $obj=new Myclass(); $obj->printvalues(); echo '$var_two: '.$obj->var_two.'\n'; ?>
  19. Is there anything like in C++ to extend or to inherit a class :public , :protected ? Only extending a class can one access public and protected all members in PHP?
  20. Getting notice/warning in this line: Notice: Trying to get property of non-object in C:\Program Files\Zend\Apache2\htdocs\mysite\application\layouts\scripts\layout.phtml on line 19 echo $this->navigation()->menu()->setAcl($obj_menuacl)->setRole($_auth->getStorage()->read()->uid); <head> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/jwplayer.js'); ?> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/swfobject.js'); ?> <?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/topmenu.css'); ?> </head> <?php $flXml=new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $container = new Zend_Navigation($flXml); Zend_Registry::set('Zend_Navigation', $container); ?> <div id="nav-menu"> <?php $obj_menuacl=new Model_MenuAcl(); $_auth=Zend_Auth::getInstance(); echo $this->navigation()->menu()->setAcl($obj_menuacl)->setRole($_auth->getStorage()->read()->uid); echo $this->loggedInAs(); echo '<br><br>'; echo 'You are in: ' . $this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?></div> <div class="mainbody"><?php echo $this->layout()->content; ?></div> <br />
  21. If i declare protected variable in a class how can i access those variable in other class inheriting that class? Can anyone post example code?
  22. I'm getting this Notice doing http://localhost/mysite/public Notice: Trying to get property of non-object in layout.phtml on line 19
  23. What to do if i put the MenuAcl.php file in layouts/script folder or in public folder?
  24. <head> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/jwplayer.js'); ?> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/swfobject.js'); ?> <?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/topmenu.css'); ?> </head> <?php $flXml=new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $container = new Zend_Navigation($flXml); Zend_Registry::set('Zend_Navigation', $container); ?> <div id="nav-menu"> <?php $obj_menuacl=new Model_MenuAcl(); $_auth=Zend_Auth::getInstance(); echo $this->navigation()->menu()->setAcl($obj_menuacl)->setRole($_auth->getStorage()->read()->uid); echo $this->loggedInAs(); echo '<br><br>'; echo 'You are in: ' . $this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?></div> <div class="mainbody"><?php echo $this->layout()->content; ?></div> <br />
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.