Hi,
I'm trying to create a view using a variable entered by the using, i started by using the code below:
<?php
$programid = $_GET['prog_id'];
//echo "$programid";
$period = $_GET['period'];
//echo "$period";
$query=mysql_query("drop view IF EXISTS '$programid';");
$query1=mysql_query("CREATE VIEW '$programid' AS SELECT distinct program_enhancement.Enhancement_id, program_enhancement.program_id, enhancement.Enhancement, enhancement.Task, enhancement.frequency, max(date) Date FROM enhancement, program_enhancement WHERE enhancement.enhancement_id = program_enhancement.enhancement_id and program_id = '$programid' group by task;"); ?>
Is it possible to create a view using a variable enter by a user?
Thanks in advance,
I'm trying to create a view using a variable entered by the using, i started by using the code below:
<?php
$programid = $_GET['prog_id'];
//echo "$programid";
$period = $_GET['period'];
//echo "$period";
$query=mysql_query("drop view IF EXISTS '$programid';");
$query1=mysql_query("CREATE VIEW '$programid' AS SELECT distinct program_enhancement.Enhancement_id, program_enhancement.program_id, enhancement.Enhancement, enhancement.Task, enhancement.frequency, max(date) Date FROM enhancement, program_enhancement WHERE enhancement.enhancement_id = program_enhancement.enhancement_id and program_id = '$programid' group by task;"); ?>
Is it possible to create a view using a variable enter by a user?
Thanks in advance,