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

Archived

This topic is now archived and is closed to further replies.

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