homepage Welcome to WebmasterWorld Guest from 54.211.68.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Zend2 Framework - Skeleton App
how to get row where id X
bethesda



 
Msg#: 4590797 posted 12:37 pm on Jul 6, 2013 (gmt 0)

Hello everyone, i have question about Sklepeton APP / Zend2 Framework
I need to pass value to variable, i use for this my edit.phtml

Ok, edit.phtml give me values to edit, form database:

- title
- artis
- link


Now i want to pass those values to variable

- $title
- $artist
- $link


And echo them:

echo $title; echo $artist; echo $link;

How can i do that ?

Thanks in advence.

 

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4590797 posted 3:34 pm on Jul 7, 2013 (gmt 0)

best is to find a couple examples of how to pass variables to your views
[google.com...]

bethesda



 
Msg#: 4590797 posted 5:02 pm on Jul 7, 2013 (gmt 0)

I want to pass (values) from database to variables.
For example (my edit.phtml view script):

EXAMPLE:
For adres: ../framework/public/edit/1


$id = "The code which is able to pull the ID from the database ";
echo $id;



In normal project, that will be:
$query = "SELECT id FROM table WHERE id=1";

ANOTHER EXAMPLE:
For adres: ../framework/public/edit/3


$title ="The code which is able to pull the ID from the database";
echo $title;



In normal project, that will be:
$query = "SELECT id FROM table WHERE id=3";

I hope that I have explained well enough what I mean ..
I intend to make every view script had the opportunity to pass values from the database to a variable.

Thanks.

bethesda



 
Msg#: 4590797 posted 7:21 pm on Jul 7, 2013 (gmt 0)

ANOTHER EXAMPLE:
For adres: ../framework/public/edit/3


$title ="The code which is able to pull the ID from the database";
echo $title;



In normal project, that will be:
$query = "SELECT title FROM table WHERE id=3";
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved