Jump to content

kemnet

New Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

kemnet's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Good day and thanks for the reply. Let me try to clarify, I have a custom software that I have written yes. But for example, if I want to implement a forum, or I want to implement a cart system, or a quiz system, although I can write them myself, a quick google search will take me to a site like Codecanyon where I can buy a script or plug in that implements the feature with some tweaking. I'm not entirely sure why you think what I said was far-fetched. Regards
  2. I am working on an application and part of the requirements is to restrict the number of users that can log in based on a license. So on install, I will provide a license that allows for 10 user accounts to be created. If the client requires 50, a different license will be provided that allows 50. I am asking, does anyone know of such a third party software that can accomplish such a task that would invalidate the need of me writing one from scratch. Regards
  3. I have an issue. I have a database(PHPadming) and PHP scripts. In the database there is an image field that stores the path to an image. The query SELECT * FROM TABLE returns all relevant information including the image. However, I changed the image data type to BLOB and uploaded the image in the database . When I execute the SELECT statement on the table in the image field I get null. What i actually am expecting to get was the binary of the image. I googled the issue and see people mentioning functions like SELCET TO_CHAR(blobfield) FROM TABLE however that does not seem to work for me. WAs wondering if anyone could help. P.S i do know this is bad practice but i already know how to use the path, im just trying it this way this is my query { # search on license number $l_name=$_POST["l_name"]; $stmt = $this->db->prepare('SELECT id, image,license_num,l_name,f_name,DATE_FORMAT(birth_d,\'%e-%m-%Y\') AS birth ,DATE_FORMAT(expires,\'%e-%m-%Y\') AS expires,license_type,license_status,CASE WHEN CURDATE( ) >= `expires` THEN \'Expired\' ELSE \'Not Expired\' END AS status FROM license WHERE l_name=?'); //-- DUMP ( CAST ( image AS image( 50 ) ) ) $stmt->bind_param("s",$l_name); $stmt->execute(); $stmt->bind_result($id,$image,$license_num,$l_name,$f_name,$birth,$expires,$license_type,$license_status,$status); } And the Json that says image is null $result[] = array( "image"=>$image, "license_num"=>$license_num, "l_name"=>$l_name, "f_name"=>$f_name, "birth"=>$birth, "expires"=>$expires, "license_type"=>$license_type, "license_status"=>$license_status, "status"=>$status,
  4. Hello, i have a query that returns multiple results but in my php query it only returns the first result...ive been checking google on while loops but still havent gotten it to work...would love if someone could look at it...thanks // while ($result= mysql_fetch_array($stmt)){ while ($stmt->fetch()) { break; // $stmt->close(); // Return unlock code, encoded with JSON $result[] = array( "l_name"=>$l_name, "f_name"=>$f_name, "birth"=>$birth, "expires"=>$expires, ); sendResponse(200, json_encode($result)); return true; sendResponse(400, 'Invalid request'); return false
  5. actually what i did to get it to work was \'Expired\' thanks for setting me on the write path
  6. like thiS? ("SELECT id,type,rig,CASE WHEN CURDATE( ) >= `expires` THEN 'Expired'ELSE 'Not Expired'END AS status FROM table WHERE form_name=?");
  7. Hello Forums. I have this query $mt = $this->db->prepare('SELECT id,type,rigFROM table WHERE form_name=?'); $mt->bind_param("s",$form_name); $mt->execute(); $mt->bind_result($id,$type,$rig); This works fine... but i want to say incase the current date is => expires date(which is a column) write expired or not expired to another column like this $mt = $this->db->prepare('SELECT id,type,rig,CASE WHEN CURDATE( ) >= `expires` THEN 'Expired'ELSE 'Not Expired'END AS status FROM table WHERE form_name=?'); $mt->bind_param("s",$form_name); $mt->execute(); $mt->bind_result($id,$type,$rig,$status); This code works fine in PHP admin but when i pull it onto my webscripts it doesnt seem to work...would love if someone could point out my error..thanks
×
×
  • 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.