Jump to content

loushou

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by loushou

  1. The reason for this is because you are using require once in both the global scope and the function scope. since it was already included one time in the global scope, php more or less ignores that second require once statement inside the function because it happens second. Essentially, that line require_once ('mysqli_connect.php'); that is inside the function 'stuff' may as well not even be there because it will get skipped. php already included it in global scope. chris.
  2. I definitely agree with taquito. At no point in your posted code to you declare $dbc. Furthermore if it is in fact declared, and you just excluded that part, in the global scope outside of the function, you never pass it to the function or declare it as global in the function so that it is accessible. Basically if you declare $dbc prior to calling the stuff function (which you may), you would likely want to add a second parameter to the stuff function for the database connection, and call it $dbc. function stuff ($cost, $dbc) { ..... code ..... } or you could (this is bad practice thought function stuff($cost) { global $dbc; ........ code ....... } chris.
  3. quotes will get you everytime
  4. Based on the code snippets that you have written, it seems that in order to solve this problem for you, we are going to need to see more. I dont see anything that sticks out as wrong here so the error has to be elsewhere. Basically we just need to see what is going on around these lines because I suspect that: 1. these lines are not getting executed or 2. the transfer between the two files is not supplying the parameters that you expect chris.
×
×
  • 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.