PHP Code Help Please
Posted: Mon Aug 19, 2013 3:53 pm
Hi,
Decided to use MYSQL. Having an issue updating/inserting/deleting from my PHP script but I can cut and paste the SQL Query into PHPMyAdmin SQL and the commands work.
This SQL Query works from PHP MyAdmin but fails in my code:
INSERT INTO `frtplus_setup_frtpluscom519443`.`setup` (`f_upsrec`, `f_add1`, `F_add2`) VALUES ('zz', 'test address AS1 rtec 2', 'test addd AS2 rec 2 ')
Code connects to database, list f_add1 content which works but the insert does not update
<?php virtual('/Connections/bhhgh.php');
mysql_select_db($database_bhhgh, $bhhgh);
$query_Recordset1 = "SELECT * FROM setup ";
$Recordset1 = mysql_query($query_Recordset1, $bhhgh) or die(mysql_error());
// display f_add1 contents of database
while ($row = mysql_fetch_assoc($Recordset1))
{
echo $row['f_upsrec'] . " " . $row['f_add1'];
echo "<br>";
}
$mqlstring= "INSERT INTO `frtplus_setup_frtpluscom519443`.`setup` (`f_upsrec`, `f_add1`, `F_add2`) VALUES ('zz', 'test address AS1 rtec 2', 'test addd AS2 rec 2 ')";
mysqli_query($bhhgh,$mqlstring);
mysql_free_result($Recordset1);
?>
Any help would be appreciated.
Gary
Decided to use MYSQL. Having an issue updating/inserting/deleting from my PHP script but I can cut and paste the SQL Query into PHPMyAdmin SQL and the commands work.
This SQL Query works from PHP MyAdmin but fails in my code:
INSERT INTO `frtplus_setup_frtpluscom519443`.`setup` (`f_upsrec`, `f_add1`, `F_add2`) VALUES ('zz', 'test address AS1 rtec 2', 'test addd AS2 rec 2 ')
Code connects to database, list f_add1 content which works but the insert does not update
<?php virtual('/Connections/bhhgh.php');
mysql_select_db($database_bhhgh, $bhhgh);
$query_Recordset1 = "SELECT * FROM setup ";
$Recordset1 = mysql_query($query_Recordset1, $bhhgh) or die(mysql_error());
// display f_add1 contents of database
while ($row = mysql_fetch_assoc($Recordset1))
{
echo $row['f_upsrec'] . " " . $row['f_add1'];
echo "<br>";
}
$mqlstring= "INSERT INTO `frtplus_setup_frtpluscom519443`.`setup` (`f_upsrec`, `f_add1`, `F_add2`) VALUES ('zz', 'test address AS1 rtec 2', 'test addd AS2 rec 2 ')";
mysqli_query($bhhgh,$mqlstring);
mysql_free_result($Recordset1);
?>
Any help would be appreciated.
Gary