Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:12:03+00:00 2026-05-24T18:12:03+00:00

i have a mistake in my code ) Fatal error: Call to undefined function

  • 0

i have a mistake in my code

) Fatal error: Call to undefined function pg_num_rows() in C:\QG\www\medical-clinic\manip\updateProduit.php on line 49
Call Stack
#   Time    Memory  Function    Location
1   0.0019  386752  {main}( )   ..\updateProduit.php:0

I use PHP5 MYSQL
Here is my original code, i don’t know why it doesn’t word:

//VERIFICATION SI PRODUIT EXISTE
$query = "
        SELECT  `panier`.`idProduit`
        FROM `panier`, `produit`
        WHERE `Produit`.`nom` = '$nom'
        AND `panier`.`idPanier` = ".$_SESSION["tempPanierSpec"]."
        AND `produit`.`idProduit` =  AND `panier`.`idProduit` 
        ";
$result = mysql_query($query);
$numRows = pg_num_rows($result);  //NOMBRE DE ROW (DONNEES) DANS LA REPONSE

//SI N'EXISTE PAS
if($numRows == 0){
    mysql_query("SELECT `produit`.`idProduit` FROM `produit` WHERE `produit`.`nom` = '$nom'");
    while($row = mysql_fetch_array($result)){ $_SESSION["tempIdProd"] = $row["idProduit"]; }//WHILE
    mysql_query("INSERT INTO Panier (idPanier, idProduit, qte)
    VALUES ('".$_SESSION["panierSpec"]."', '".$_SESSION["tempIdProd"]."', '$qte')");
}
//SI EXISTE
else{

    while($row = mysql_fetch_array($result)){ $_SESSON["tempIdProd"] = $row["idProduit"];}
    $query = "
            UPDATE `panier` 
            SET `panier`.`qte` = `panier`.`qte` + $qte 
            WHERE `panier`.`idPanier` = '".$_SESSION["tempPanierSpec"]."'
            AND `panier`.`idProduit` = ". $_SESSION["tempidProd"];
    mysql_query($query);
}       

Thanks to all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:12:04+00:00Added an answer on May 24, 2026 at 6:12 pm

    You need to use mysql_num_rows($result) — pg_num_rows($result) is only for PostreSQL, hence the name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have done a small mistake in my code that is not allowing me
I think that by mistake I have enabled the deep code analysis. How do
I am an intermediate C programmer. If you have made any coding mistake that
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
i have implement this code from programming pearls and i think it should be
whenever i run the code below it occurs to me I have made a
I have a class, in which i declare a static function. I register this
I have a AJAX script which sends a POST request to PHP with some
I am learning to work with PHP and have a simple problem. <?php ini_set('display_errors',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.