Page 1 of 1

query()

Posted: Fri Aug 11, 2006 4:59 am
by dotoho
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


dear all ,
   I have had error message : Fatal error: Call to undefined function query() in D:\htdocs\quiz\data.php on line 39 
    when i used function query()  .How to do this,brosss???
  and this is my code :

Code: Select all

<html>
<body>
<p> 1.Hay chon 1 trong 2 : </p>
<?php
 $question= $_POST['question'];
 $answer1 = $_POST['answer1'];
 $answer2 = $_POST['answer2'];
 
 if(!$question||!$answer1||!$answer2){
  echo 'BAn dien ko day du.hay quay lai de hoan thanh';
  exit;
 }
 if(!get_magic_quotes_gpc())
 {
 $question  = addslashes($question);
 $answer1  = addslashes($answer1);
 $answer2  = addslashes($answer2);
 }
 
@ $db = mysql_connect("localhost", "root","ha1985") or die("No way");
 
mysql_select_db("myapp",$db) or die("KhĂ´ng ch&#7885;n c&#417; s&#7903; d&#7919; li&#7879;u &#273;&#432;&#7907;c");
 
 
       
	[size=18]	$query = "insert into question " . "(question,answer1,answer2) values"
			. "('$question', '$answer1', '$answer2')";
			
	query($query);
		$msg .= "<h3>complete to sign";
		$question = $answer1 = $answer2 = "";[/b]
            
        
 

?>
</body>
</html>


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Aug 11, 2006 5:01 am
by Benjamin

Code: Select all

query($query);
Should be

Code: Select all

mysql_query($query);

Posted: Fri Aug 11, 2006 5:12 am
by dotoho
astions wrote:

Code: Select all

query($query);
Should be

Code: Select all

mysql_query($query);
runnnn
okei okei,thanxxx much ,
but u can explain for me that why i can't use only "query " ???

Posted: Fri Aug 11, 2006 5:13 am
by JayBird
dotoho wrote:but u can explain for me that why i can't use only "query " ???
...becuase it isn't a PHP function