How to fix this Fatal error: Call to undefined function save_stock()

Hi everyone.
I have this error in my script Fatal error: Call to undefined function save_stock() in C:\xampp\htdocs\pharmacysystem\manager\stock.php on line 146 but i don’t know how to fix it though I tried a lot.

Please help me.

This is stock.php

<?php
session_start();
?>
<?php include ('../controls/functions.php'); ?>
<!DOCTYPE html>
<html>
<head>
      <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Pharmacy Management System : Manager dashboard</title>
    <!-- BOOTSTRAP STYLES-->
    <link href="/pharmacysystem/assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FONTAWESOME STYLES-->
    <link href="/pharmacysystem/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
     <!-- MORRIS CHART STYLES-->
    <link href="/pharmacysystem/assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
        <!-- CUSTOM STYLES-->
    <link href="/pharmacysystem/assets/css/custom.css" rel="stylesheet" />
     <!-- GOOGLE FONTS-->
   <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="main.php">PMS:Manager Dashboard</a> 
            </div>
<div style="color: white;
padding: 15px 50px 5px 50px;
padding-right: 20px;
float: left;
font-size: 26px;">  Pharmacy Management System  </div>

  <div style="color: white;
padding: 15px 50px 5px 50px;
float: right;
font-size: 16px;"> <?php

// Prints the day, date, month, year, time, AM or PM
echo date("l jS \of F Y ");
?>  &nbsp; 
<div class="dropdown" style="float:right;">
  <button class="dropbtn"><span><i class="fa fa-user-o"></i></span>&nbspWelcome <?php echo $_SESSION['username']; ?></button>
  <div class="dropdown-content">
       <a href="#"><span><i class="fa fa-edit"></i></span>Edit account</a>
    <a href="index.php" ><span><i class="fa fa-sign-out"></i></span>Logout</a> </div>
  </div>
</div>
        </nav>   
           <!-- /. NAV TOP  -->
                <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                <li class="text-center">
                    <img src="/usrms/assets/img/user.png" class="user-image img-responsive"/>
          </li>
                    
                    <li>
                        <a  href="main.php"><i class="fa fa-dashboard fa-3x"></i> Dashboard</a>
                    </li>
                     
                    
                    <li>
                       <a  href="backup.php"><i class="fa fa-database fa-3x"></i> Backup and Restore</a>
                    </li>
                    <li>
                        <a  href="viewprescription.php"><i class="fa fa-user-o fa-3x"></i> View Prescription</a>
                    </li>
                 <li>
                        <a href="#"><i class="fa fa-users fa-3x"></i> Manage Stock</a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="salesdetails.php">View Stock Details</a>
                            </li>
                            <li>
                                <a class="active-menu"  href="stock.php">Enter Stock</a>
                            </li>
                        </ul>
                      </li>   
                      <li>
                        <a href="#"><i class="fa fa-users fa-3x"></i> Users</a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a href="newuser.php">Add New User</a>
                            </li>
                            <li>
                                <a  href="allusers.php">All Users</a>
                            </li>
                        </ul>
                      </li> 
               </ul>
            </div>
            
        </nav>  
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper" >
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                     <h2>Manager Dashboard</h2>   
                        <h5>Welcome John Njeje, Love to see you back. </h5>
                    </div>
                </div>              
                 <hr />
                <div class="container-fluid">
  <div class="add-result">
             <form action="" method="POST" accept-charset="utf-8">
                      
             <label for="usermail">Drug Name:</label> 
       <input type="text" name="drug_name" value="drugname" required="text" 
          onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Drug Name';}"
       >
             <br>
             <label for="password">Category:</label>     
             <input type="text" name="category" value="category"  required="text"
             onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Category';}"
             ><br>

             <label for="password">Quantity:</label>     
             <input type="tel" name="quantity" value="quantity" required="text"
             onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Quantity';}"
             ><br>

             <label for="password">Cost Per Unit:</label>     
             <input type="text" name="cost" value="costperunit" required="text"
             onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Cost Per Unit';}"
             ><br>

             <label for="password">Total Cost:</label>     
             <input type="text" name="totalcost" value="totalcost" required="text"
             onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Total Cost';}"
             ><br>

              <label for="password">Date Supplied:</label>     
             <input type="date" name="datesupplied" value="datesupplied" required="text"
             onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Your Date Supplied';}"
             ><br>

             <button type="submit" name="addstock">Add New Stock</button>
             <?php save_stock(); ?>
              </form>
             
</div>
          
         </div>
          
            <footer>
        <p>Copyright &copy; 2017 PMS- All Rights Reserved- Designed by High Dimension</p>
        </footer>
    </div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
        </div>
     <!-- /. WRAPPER  -->
    <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
    <!-- JQUERY SCRIPTS -->
    <script src="assets/js/jquery-1.10.2.js"></script>
      <!-- BOOTSTRAP SCRIPTS -->
    <script src="assets/js/bootstrap.min.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="assets/js/jquery.metisMenu.js"></script>
     <!-- MORRIS CHART SCRIPTS -->
     <script src="assets/js/morris/raphael-2.1.0.min.js"></script>
    <script src="assets/js/morris/morris.js"></script>
      <!-- CUSTOM SCRIPTS -->
    <script src="assets/js/custom.js"></script>
    
   
</body>
</html>

And this is function.php

function save_stock(){

include 'connection.php';

if(isset($_POST['addstock']))
    {
      $drugname=$_POST['drug_name'];
      $category=$_POST['category'];
      $description=$_POST['description'];
      $company=$_POST['company'];
      $supplier=$_POST['supplier'];
      $quantity=$_POST['quantity'];
      $cost=$_POST['cost'];
      $totalcost=$_POST['totalcost'];
      $date=$_POST['datesupplied'];
      

  $insert="insert into stock_details (drug_name,category,description,company,supplier,quantity,cost,totalcost,datesupplied) values('$drugname','$category','$description','$company','$supplier','$quantity','$cost','$totalcost','$date')";

  $run_insert=mysql_query($insert);
      if($run_insert === FALSE) { 
          die(mysql_error()); // TODO: better error handling
      }
      
      if($run_insert)
      {
        echo "<script>alert ('stock Details Successful Saved')</script>";
        exit();

      }
      else
      {
        echo "<script>alert ('Error While Saving stock Details')</script>";
        exit();
      
      }
}

}

Hi @sadock016 and welcome to the forums.

The error message looks as though the …/controls/functions.php file is not being loaded or there are errors in the included file,

Try adding these lines to the top of stock,php page

<?php 
error_reporting(-1);
ini_set('display_errors', 'true');


It should display more information on the errors and warnings.

1 Like

Did you spell the name of the included PHP file correctly (function.php vs functions.php)? BTW, if you want to save the form on submit you’ll have to set an appropriate action to the form, not just call that function at the bottom of the form as this will attempt to save the stock each time the page gets loaded.

(x-post)

1 Like

@m3g4p0p Yes I spell the name of the included PHP file correctly it’s functions.php not function.php

@John_Betong I tried but it doesn’t work.

Does your functions.php file have the php open and close tags around it, outside of the section you posted?

http://php.net/manual/en/function.include.php

@droopsnoot Yes functions.php file have the php open and close tags around it, outside of the section I posted.

Is the same error message showing or any other messages?

@John_Betong
The same error message showing brother.

If you are using php7 try this at the top of every page.

<?php
 declare(strict_types=1);

You’re a sitting duck for SQL Injection attacks as the user submitted data isn’t even escaped and no attempt is made at validation of the user submitted data.

Also the mysql_* extension that you’ve used was removed from PHP as of version 7.0 so if you were to run your code on any server running PHP version 7.0 or newer it’ll fail. The best way to escape user submitted data, once it has been validated, is to use prepared statements

As there are other things in your functions.php code, is it possible that one of those is causing the problem?

@droopsnoot Here is my functions.php

<?php
//hii ni function kwa ajili ya kulogin student
function login(){
    session_start();
    include 'connection.php';

    if (isset($_POST['login'])) {
        
        $username=$_POST['username'];
        $password=$_POST['password'];
        $checkbox=$_POST['checkbox'];

        $newpassword=md5($password);

        $select_user="select * from pharmacist where username='$username' AND password='$password'";
        $run_user=mysql_query($select_user);
        
        if (mysql_num_rows($run_user)>0) {
            $_SESSION['username']=$username;
            echo "<script>window.open('main.php','_self')</script>";
        }
        else{
            echo "<div class='error-msg'><p>Your username or password is incorrect.</p></div>";
            exit();
        }
    }

}

//hii ni function kwa ajili ya kulogin teachers
function manager_login(){
    session_start();
    include 'connection.php';

    if (isset($_POST['login'])) {
        
        $username=$_POST['username'];
        $password=$_POST['password'];
        $checkbox=$_POST['checkbox'];

        $newpassword=md5($password);

        $select_user="select * from manager where username='$username' AND password='$password'";
        $run_user=mysql_query($select_user);
        
        if (mysql_num_rows($run_user)>0) {
            $_SESSION['username']=$username;
            echo "<script>window.open('main.php','_self')</script>";
        }
        else{
            echo "<div class='error-msg'><p>Your username or password is incorrect.</p></div>";
            exit();
        }
    }

}




function update()
{
    include 'connection.php';
    $aid='aid';

$select_details_admin="select * from admin where aid='$aid'";
    $run_admin=mysql_query($select_details_admin);
    $row_data_admin=mysql_fetch_array($run_admin);
    $aid=$row_data_admin['aid'];

}

if(isset($_POST['update'])){
    $aid=$_SESSION['username'];

$username=$_POST['username'];
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$password=$_POST['password'];
$phonenumber=$_POST['phonenumber'];
$email=$_POST['email'];


// Retrieve data from database 
$sql="update admin set username='$username', email='$email', firstname='$firstname', lastname='$lastname',password='$password',phonenumber='$phonenumber' WHERE username='$aid'";
$run_update=mysql_query($sql);
if($run_update) {
    echo "<script>window.open('allusers.php','_self')</script>";
}
else{
echo "<font color=red>Update Failed, Try again</font>";
}
}


function view_prescription(){
  include 'connection.php';
  $select_prescription_details="select * from prescription_details";
  $run_prescription_details=mysql_query($select_prescription_details);

  while ($row_data=mysql_fetch_array($run_prescription_details)) {

      $prescription_id=$row_data['prescription_id'];
      $customername=$row_data['customername'];
      $age=$row_data['age'];
      $sex=$row_data['sex'];
      $phone=$row_data['phone'];
      $date=$row_data['date'];
      $drugname=$row_data['drugname'];
      $strength=$row_data['strength'];
      $dose=$row_data['dose'];
      $quantity=$row_data['quantity'];
    
    echo "<tr>
        <td>$prescription_id</td>
        <td>$customername</td>
        <td>$age</td>
        <td>$sex</td>
        <td>$phone</td>
        <td>$date</td>
        <td>$drugname</td>
        <td>$strength</td>
        <td>$dose</td>
        <td>$quantity</td>
        <div class='handle-button'>
        <td><a href=\"updateadmin.php?prescription_id=".$row_data['prescription_id']."\"><button>Update</button></a><div id='action'></div></div>
        </td>
        <div class='handle-button'>
        <td><a href=\"deleteadmin.php?prescription_id=".$row_data['prescription_id']."\"><button>Delete</button></a><div id='action'></div></div>
        </td>
    </tr>";

      }
}


 function add_new(){

include 'connection.php';

$select="select  * from usertype ";
$run=mysql_query($select);
$row=mysql_fetch_array($run);
$usertype=$row['usertype'];

if(isset($_POST['addnewuser']))
    {
      $username=$_POST['username'];
      $email=$_POST['email'];
      $firstname=$_POST['firstname'];
      $lastname=$_POST['lastname'];
      $password=$_POST['password'];
      $quantity=$_POST['phone'];
      $role=$_POST['usertype'];
      $staff=$_POST['staffid'];
      $postal=$_POST['postaladdress'];
      $date=$_POST['date'];

  if ($role=="Manager") {

  $insert="insert into manager (username,email,firstname,lastname,password,phone,staffid,postaladdress,date) values('$username','$email','$firstname','$lastname','$password','$quantity','$staff','$postal','$date')";

  $run_insert=mysql_query($insert);
      if($run_insert === FALSE) { 
          die(mysql_error()); // TODO: better error handling
      }
      
      if($run_insert)
      {
        echo "<script>alert ('manager Details Successful Saved')</script>";
        exit();

      }
      else
      {
        echo "<script>alert ('Error While Saving manager Details')</script>";
        exit();
      
      }
}



else{

      
      $insert="insert into pharmacist (username,email,firstname,lastname,password,phone,staffid,postaladdress,date) values('$username','$email','$firstname','$lastname','$password','$quantity','$staff','$postal','$date')";

      $run_insert=mysql_query($insert);
      if($run_insert === FALSE) { 
          die(mysql_error()); // TODO: better error handling
      }
      
      if($run_insert)
      {
        echo "<script>alert ('pharmacist details Successful Saved')</script>";

      }
      else
      {
        echo "<script>alert ('Error While Saving pharmacist Details')</script>";
      
      }
    }

}

}


function view_user_type(){
include 'connection.php';
$select_usertype="select * from usertype";
    $run_usertype=mysql_query($select_usertype);

    while ($row_data=mysql_fetch_array($run_usertype)) {

        $usertype=$row_data['usertype'];
        
        echo "<option>$usertype</option>";
        

            }
        }



function add_save_data(){

include 'connection.php';

if(isset($_POST['savebtn']))
    {
      $customername=$_POST['customername'];
      $age=$_POST['age'];
      $sex=$_POST['sex'];
      $phone=$_POST['phone'];
      $date=$_POST['date'];
      $drugname=$_POST['drugname'];
      $strength=$_POST['strength'];
      $dose=$_POST['dose'];
      $quantity=$_POST['quantity'];
      

  $insert="insert into prescription_details (customername,age,sex,phone,date,drugname,strength,dose,quantity) values('$customername','$age','$sex','$phone','$date','$drugname','$strength','$dose','$quantity')";

  $run_insert=mysql_query($insert);
      if($run_insert === FALSE) { 
          die(mysql_error()); // TODO: better error handling
      }
      
      if($run_insert)
      {
        echo "<script>alert ('prescription Details Successful Saved')</script>";
        exit();

      }
      else
      {
        echo "<script>alert ('Error While Saving prescription Details')</script>";
        exit();
      
      }
}


function save_stock(){

include 'connection.php';

if(isset($_POST['addstock']))
    {
      $drugname=$_POST['drug_name'];
      $category=$_POST['category'];
      $description=$_POST['description'];
      $company=$_POST['company'];
      $supplier=$_POST['supplier'];
      $quantity=$_POST['quantity'];
      $cost=$_POST['cost'];
      $totalcost=$_POST['totalcost'];
      $date=$_POST['datesupplied'];
      

  $insert="insert into stock_details (drug_name,category,description,company,supplier,quantity,cost,totalcost,datesupplied) values('$drugname','$category','$description','$company','$supplier','$quantity','$cost','$totalcost','$date')";

  $run_insert=mysql_query($insert);
      if($run_insert === FALSE) { 
          die(mysql_error()); // TODO: better error handling
      }
      
      if($run_insert)
      {
        echo "<script>alert ('stock Details Successful Saved')</script>";
        exit();

      }
      else
      {
        echo "<script>alert ('Error While Saving stock Details')</script>";
        exit();
      
      }
}

}

function yakuvuta_jina_la_dawa(){

include ('connection.php');

        $vuta_data="select * from stock_details'";
        $run_vuta=mysql_query($vuta_data);
        while ( $row=mysql_fetch_array($run_vuta)) {
            $jina_la_dawa=$row['drug_name'];
            echo "<option>$jina_la_dawa</option>";
        }

}

function show_status(){

include ('connection.php');

        $vuta_data="select * from stock_details where status='Available'";
        $run_vuta=mysql_query($vuta_data);
        while ( $row=mysql_fetch_array($run_vuta)) {
        $stock_id=$row['stock_id'];
        $drugname=$row['drug_name'];
        $category=$row['category'];
        $description=$row['description'];
        $cost=$row['cost'];
        $totalcost=$row['totalcost'];
        $status=$row['status'];
        $date=$row['datesupplied'];
    
    echo "<tr>
        <td>$stock_id</td>
        <td>$drugname</td>
        <td>$category</td>
        <td>$description</td>
        <td>$cost</td>
        <td>$totalcost</td>
        <td>$status</td>
        <td>$date</td>
        <div class='handle-button'>
        <td><a href=\"updateadmin.php?stock=".$row['stock_id']."\"><button>Update</button></a><div id='action'></div></div>
        </td>
        <div class='handle-button'>
        <td><a href=\"deleteadmin.php?stock=".$row['stock_id']."\"><button>Delete</button></a><div id='action'></div></div>
        </td>
        </tr>";
      }
}

function view_drugamount(){
    include ('connection.php');

    $select_drugname="select * from stock_details";
    $run_drugname=mysql_query($select_drugname);

    while ($row_drugname=mysql_fetch_array($run_drugname)) {
        $stock_id=$row_dawa['stock_id'];
        $drugname=$row_dawa['drug_name'];
        $category=$row_dawa['category'];
        $quantity=$row_dawa['quantity'];
        $cost=$row_dawa['cost'];
        $totalcost=$row_dawa['totalcost'];
        $date=$row_dawa['datesupplied'];
        if ($idadi==0) {
            echo "<tr>
            <td>$stock_id</td>
            <td>$drugname</td>
            <td>$category</td>
            <td bgcolor='red'>ZIMEISHA</td>
            <td>$cost</td>
            <td>$totalcost</td>
            <td>$date</td>
        </tr>";
        }else{
            echo "<tr>
            <td>$stock_id</td>
            <td>$drugname</td>
            <td>$category</td>
            <td>$quantity</td>
            <td>$cost</td>
            <td>$totalcost</td>
            <td>$date</td>
        </tr>";
        }

        
    }


function yakutoa_dawa(){
    include ('connection.php');

        if (isset($_POST['toa-dawa'])) {
            $jina_la_dawa=$_POST['stock_id'];
            $idadiyake=$_POST['quantity'];
            $customername=$_POST['customername'];
            $cost=$_POST['cost'];
            $totalcost=$_POST['totalcost'];
    

            $vuta_data="select * from stock_details where drug_name='$jina_la_dawa'";
                $run_vuta=mysql_query($vuta_data);
         $row=mysql_fetch_array($run_vuta);
            $id_ya_dawa=$row['stock_id'];
            $idadi_ya_dawa_zilizopo=$row['quantity'];

                if ($idadiyake > $idadi_ya_dawa_zilizopo) {
                    echo "<script>alert('Dawa unazotoa ni zaidi ya zilizopo hutoweza kutoa angalia vizuri')</script>";
                    exit();
                }else{

            $ingiza="insert into medicine_provided (stock_id,customername,quantity,cost,totalcost,date) values('$id_ya_dawa','$customername','$idadiyake','$cost','$totalcost',NOW())";
        $run_ingiza=mysql_query($ingiza);

        if ($run_ingiza) {
            echo "Imetoka";


            $dawa_zilizobaki=$idadi_ya_dawa_zilizopo-$idadiyake;

            if ($dawa_zilizobaki==0) {
                $update_table_ya_dawa="update dawa set idadi='$dawa_zilizobaki', status='Unavailable' where stock_id='$id_ya_dawa'";
            $run_update=mysql_query($update_table_ya_dawa);
            }
            else{
                $update_table_ya_dawa="update dawa set idadi='$dawa_zilizobaki' where stock_id='$id_ya_dawa'";
            $run_update=mysql_query($update_table_ya_dawa);
            }
            
        }else{
            echo "Aijatoka";
            exit();
        }
        }
        }

}



function view_manager_data(){
  include ('connection.php');
  $select_admin_detils="select * from manager";
  $run_admin_details=mysql_query($select_admin_detils);

  while ($row_data=mysql_fetch_array($run_admin_details)) {

    $aid=$row_data['manager_id'];
    $username=$row_data['username'];
    $email=$row_data['email'];
    $firstname=$row_data['firstname'];
    $lastname=$row_data['lastname'];
    $password=$row_data['password'];
    $phonenumber=$row_data['phone'];
    $postaladdress=$row_data['postaladdress'];
    $staffid=$row_data['staffid'];
    $date=$row_data['date'];
    
    echo "<tr>
        <td>$aid</td>
        <td>$username</td>
        <td>$email</td>
        <td>$firstname</td>
        <td>$lastname</td>
        <td>$password</td>
        <td>$phonenumber</td>
        <td>$postaladdress</td>
        <td>$staffid</td>
        <td>$date</td>
        <div class='handle-button'>
        <td><a href=\"updateadmin.php?aid=".$row_data['manager_id']."\"><button>Update</button></a><div id='action'></div></div>
        </td>
        <div class='handle-button'>
        <td><a href=\"deleteadmin.php?aid=".$row_data['manager_id']."\"><button>Delete</button></a><div id='action'></div></div>
        </td>
        </tr>";
      }
}

function view_pharmacist(){
  include ('connection.php');
  $select_admin_detils="select * from pharmacist";
  $run_admin_details=mysql_query($select_admin_detils);

  while ($row_data=mysql_fetch_array($run_admin_details)) {

    $aid=$row_data['pharmacist_id'];
    $username=$row_data['username'];
    $email=$row_data['email'];
    $firstname=$row_data['firstname'];
    $lastname=$row_data['lastname'];
    $password=$row_data['password'];
    $phonenumber=$row_data['phone'];
    $postaladdress=$row_data['postaladdress'];
    $staffid=$row_data['staffid'];
    $date=$row_data['date'];
    
    echo "<tr>
        <td>$aid</td>
        <td>$username</td>
        <td>$email</td>
        <td>$firstname</td>
        <td>$lastname</td>
        <td>$password</td>
        <td>$phonenumber</td>
        <td>$postaladdress</td>
        <td>$staffid</td>
        <td>$date</td>
        <div class='handle-button'>
        <td><a href=\"updateadmin.php?aid=".$row_data['pharmacist_id']."\"><button>Update</button></a><div id='action'></div></div>
        </td>
        <div class='handle-button'>
        <td><a href=\"deleteadmin.php?aid=".$row_data['pharmacist_id']."\"><button>Delete</button></a><div id='action'></div></div>
        </td>
        </tr>";
      }
}


}
}

?>

Off Topic

@sadock016: when you post code on the forums, you need to format it so it will display correctly.

You can highlight your code, then use the </> button in the editor window, or you can place three backticks ``` (top left key on US/UK keyboards) on a line above your code, and three on a line below your code. I find this approach easier, but unfortunately some European and other keyboards don’t have that character.

@TechnoBear got u bro…

You’re missing a closing curly-brace, at the end of the add_save_data() function, so your next function definition (for save_data()) is inside the previous function. Then you seem to have an extra one at the end of the definition of save_data(), my mental count ends that function at -1 when it should be at zero.

@droopsnoot thanks alot bro it works fine nooow.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.