Welcome to WebmasterWorld Guest from 174.129.135.89

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Zend2 Framework - Skeleton App

how to get row where id X

   
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.
3:34 pm on Jul 7, 2013 (gmt 0)

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



best is to find a couple examples of how to pass variables to your views
[google.com...]
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.
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";