MySQL Forums
Forum List  »  Connector/Node.js

Re: Data Insert Using XML
Posted by: noxhanti piliso
Date: June 11, 2006 02:20PM

I know this is not the right forum but i can't get answers elsewhere. My problem is similar to the above except that it involves wml. I created the code below, but I get errors (unexpected end to wml source).Does anyone know what to do?


<?xml version="1.0"?>

<card id="card2" title="userdetails">

User Details:<br/>

Enter User ID<br/>
<input name="repid"/><br/>
Enter Name<br/>
<input name="name"/><br/>
Enter address<br/>
<input name="address"/><br/>

Enter Telephone Number<br/>
<input name="tel"/><br/>

<go method="get" href="insert.php">
<postfield name="customer_id" value="$(repid)"/>
<postfield name="name" value="$(name)"/>
<postfield name="address" value="$(address)"/>
<postfield name="tel" value="$(tel)"/>
Submit Data

header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"\">";

<card id="card2" title="add">


//connect to database server
$connection = mysql_connect("localhost", "root", "password")
or die ("connection failed");

//Select the database
$db = mysql_select_db("db_wap", $connection)
or die ("failed to select database <br />\n");

//execute a query
$sql = mysql_query("INSERT INTO 'tbl_User' ('repid', 'name', 'address', 'tel') Values ('$_GET[repid]', '$_GET[name]', '$_GET[address]', '$_GET[tel]')") or die("Input failed");

if (!$sql) {
echo "Error cannot Insert record.!!!<BR>"; mysql_error;exit;
}else {
echo "record inserted";

//insert OK inform user

print "<b>Customer Database:</b> <br/>";


Options: ReplyQuote

Written By
January 04, 2006 12:36AM
Re: Data Insert Using XML
June 11, 2006 02:20PM
July 22, 2006 08:23PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.