Jump to content

getting the result from an MySQL Query and assigning it to a PHP variable


truegilly

Recommended Posts

Hi,

Wondering if any of you gurus can give me an insight into this one.

Ive got a page which allows a logged in user to upload and delete files. One of the constraints I want to implement is so a user can only store a maximum of 20mb of data within my database. The files are stored as BLOBs

The way I have been trying to get this working was by using the query below and storing the value it returns in a PHP variable, and then using an if statement to test weather the user has enough space to upload files, else it provides an error message that says "sorry no space". The problem ive got is that im not sure how to assign the result of this query into a variable

Here is my Query and the code that goes with it

[color=navy]SELECT SUM(dbArtefactFileSize) AS FileSizeAllowence, dbArtefactId, dbArtefactFileSize, dbArtefactFileType, dbArtefactFileName FROM Artefact WHERE dbEmployeeId = ? GROUP BY dbEmployeeId

mysqli_stmt_bind_param($statement, "s", $_SESSION['sessOwner']['UserId'] );

mysqli_stmt_execute($statement);[/color]

Could anyone provide the code that allows me to store the result in a variable ??

Any help is most appreciated

Truegilly
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.