input SQL data through text box and get nothing?
- From: marslee@xxxxxxxxxxx
- Date: 31 May 2005 09:38:20 -0700
I want to add SQL command through a textbox in the form using post
method,but when i execute the following file, nothing is added to the
database.
I can add
$sqlol = "update acc_account
set user_name='k'
where accountid=1";
to the database if it was added to the file but when i use $result =
mysql_query($sql); which execute the query, it get nothing. However,
the $sql statement do print out on the screen using print.
Any idea?
<?php
$conn=mysql_connect('localhost', 'shytr8');
if(!$conn)
{print "Error- Could not connect to MYSQL";
exit;}
$er=mysql_select_db("test");
if(!$er){
print "Error- Could not create er";
$query = "CREATE DATABASE test";
mysql_query($query);}
$sql=$_POST[SQLcommand];
$result = mysql_query($sql);
?>
.
- Follow-Ups:
- Re: input SQL data through text box and get nothing?
- From: Jerry Stuckle
- Re: input SQL data through text box and get nothing?
- Prev by Date: Re: How do I return 3 results and print </tr>
- Next by Date: Re: Detecting PDF files in a folder and sorting them by date
- Previous by thread: phpldapadmin faile to create courier email account
- Next by thread: Re: input SQL data through text box and get nothing?
- Index(es):
Relevant Pages
|