php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18940 Unable to write to DB with PHP 4.2.2
Submitted: 2002-08-16 10:16 UTC Modified: 2002-10-09 13:53 UTC
From: marty at comitaustralia dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.2.2 OS: Redhat 7.2
Private report: No CVE-ID: None
 [2002-08-16 10:16 UTC] marty at comitaustralia dot com
I have been using apache, php and postgresql for quite a while now.  Recently I upgraded to the lates versions of all the components.

Apache 1.3.26
PHP 4.2.2
Poistgresql 7.2.1

After the upgrade I found that I could read from the DB ie. select requests, but not write to the DB ie. insert, update.

I get no error messages.

I have tried everything including reinstalling apache, postgresql and php fresh, but have been unsuccessful.

The only way I have been able to make everything work is to go back to PHP 4.1.2 and keep apache 1.3.26 and postgresql 7.2.1

Is there a bug in version 4.2.2 that prevents full control of postgresql??

Cheers,
Marty

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-16 10:20 UTC] kalowsky@php.net
None that I know of, it works fine on my FreeBSD system.  Can you attach a sample script for us to see what you're doing, and possibly a sample schema?

Heck just have the PHP script make the schema, and perform the queries.
 [2002-09-21 01:54 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2002-10-09 10:46 UTC] marty at comitaustralia dot com
I have just upgraded to apache 2 and php 4.2.3 and have the same problem.  I can execute the following successfully:


if (!($myFile=fopen("product.txt", "r")))
    {
	  exit;
	}
	
  while (!feof($myFile)) {
    $elements=fgetcsv($myFile,1024);
	if (!($elements[7]=='?')) {
	  $Sql = "INSERT into tblproduct (productid,productdesc,package,lastsale,price,gst,deleted) VALUES ('$elements[0]','" . addslashes($elements[1]) ."','$elements[2]','$elements[7]','$elements[3]','$elements[14]','f')";
	  if(!($Sqlexec = pg_exec($db, $Sql)))
	  print ($elements[0]);
	}
  }
  
  fclose ($myFile);


where product.txt is a comma seperated text file.

However, when I try to execute the following I get no response from the server:


function search($id,$name) {

$db = pg_connect("dbname=jpm user=postgres");
$cuid = strtoupper($id)."%";
  
  If ($id != "") {
    $strSql="SELECT custId, name, street, suburb FROM tblCust WHERE custId like '$cuid'"; }
  else {
    $strSql="SELECT custId, name, street, suburb FROM tblCust where name like '$name%'";
  }
  $result = pg_exec($db, $strSql);
  
   $numrows = pg_numrows($result);

  
  if ($numrows==0) { ?>
	<h2 align="center">No entries were found matching the search data.</h2>
	<center>
	  <input type="button" value="New Search" onclick="location.href='cust_records.php'">
	</center>
     <? 
  }
  
  if (($numrows==1)) {// && ($name=="")) { 
    $res = pg_fetch_array ($result,0);
    show(); ?>	
	<script>
	  parent.showdata('<? print"$res[custid]" ?>','<? print"$res[name]" ?>');
	</script>
<?} 
.........


Everything works perfectly when I use PHP verision 4.1.2 


Can someone please help?

Marty
 [2002-10-09 13:53 UTC] marty at comitaustralia dot com
I have just found that it's php that's not reading post values fro html header, so this bug has nothing to do with postgresql.  

Sorry,
Marty
 [2002-10-09 13:53 UTC] marty at comitaustralia dot com
I have just found that it's php that's not reading post values fro html header, so this bug has nothing to do with postgresql.  

Sorry,
Marty
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 06:01:30 2024 UTC