Jump to content

function executeUpdate ... !!!


manalnor

Recommended Posts

Hello dear friends,

 

I've 2 files x.php and y.php and func.php

 

Where x.php  is an form

 

<form action="y.php" method="post" name="form">

Name : <input name="name" type="text" id="name" value="">

<input type="Submit" name="Submit" value="Save">

 

it should send informations to file y.php

 

and file y.php

 

include "func.php";
$sql= "update table set name='$name'";
executeupdate($sql);

 

at func.php  there is function of executeupdate as following

 

function executeUpdate($sql)
{
mysql_query($sql) or die("query failed: $sql".mysql_error());
}

 

Now x.php  ---> send info to y.php  that needs func.php  to update the database table

 

 

NOW !!!!!! my question why why why it works with an hosting and not working on other hosting.

 

does function  executeUpdate($sql) no longer work or what !

 

please help and advice me

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/228442-function-executeupdate/
Share on other sites

 

the error when i click submit, it does not update the database table with the new entry.

 

Indeed there is connection, assume it.

 

Well i've tried it on many hosting some works and other not

then i figure out if i made that changes, it will works

 

For file x.php

 

if(isset($_POST[s1]))
{
$qeg = "update table set
name = '$_POST[name]' "; 
$reg = mysql_query($qeg) or die(mysql_error());
echo "Updated";
}

<form action="y.php" method="post" name="form">

Name : <input name="name" type="text" id="name" value="">

<input type="Submit" name="s1" value="Save"> 

 

this will works ! so i only changed function executeUpdate

 

so any Why

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.