开发者

mysql and php views

i am writing a html form, that simply passes data to a php one, and then to an sql database. my question is, should view be stored in php or sql (and call them from php)? i could do that. the problem is t开发者_开发百科hat in my views i have variables. i.e each time i call them i have different parameters in them.

so my php code looks like this:

$this->query = "SELECT student.gender FROM student WHERE email ='$this->email'";

if i put the above view in mysql, i can't use a variable like "email" right?

so where are view better to be stored? same goes for procedures ?


$this->query = sprintf("SELECT student.gender FROM student WHERE email ='%s'", $this->email);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜