Jump to content

Search the Community

Showing results for tags 'blob'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 5 results

  1. Hi I am new. I am using Bootstrap css. I have an issue to display image with data type BLOB, Really I don't know how to do this. Pls advise me how to do this. Thanks maideen My php insert Code <?php require_once '../inc/config.php'; if(isset($_POST['add'])) { if($_SERVER["REQUEST_METHOD"] == "POST") { $sid =$_POST['sid']; $sname =$_POST['sname']; $nric=$_POST['nric']; $gender=$_POST['gender']; $dob=$_POST['dob']; $courseid=$_POST['courseid']; $pname=$_POST['pname']; $emailid=$_POST['emailid']; $hpno=$_POST['hpno']; $homeno=$_POST['homeno']; $offno=$_POST['offno']; $emergencyno=$_POST['emergencyno']; $address=$_POST['address']; $city=$_POST['city']; $state=$_POST['state']; $country=$_POST['country']; $hname=$_POST['hname']; $alergies=$_POST['alergies']; $milkpowder=$_POST['milkpowder']; $specialfoods=$_POST['specialfoods']; $specactivy1=$_POST['specactivy1']; $specactivy2=$_POST['specactivy2']; $specactivy3=$_POST['specactivy3']; $specactivy4=$_POST['specactivy4']; $simage=$_POST['simage']; $createdby =$_POST['username']; $time = strftime("%X"); $date = strftime("%B %d,%Y"); //$createdon= $date; $createdon = date("Y-m-d H:i:s"); $bool = true; $sql="insert into tbl_student_master(sid,sname,nric,gender,dob,courseid,pname,emailid,hpno,homeno,offno,emergencyno,address,city,state,country,hname,alergies,milkpowder, specialfoods,specactivy1,specactivy2,specactivy3,specactivy4,simage,createdby,createdon) values ('$sid','$sname','$nric','$gender','$dob','$courseid','$pname','$emailid','$hpno','$homeno','$offno','$emergencyno','$address','$city','$state','$country', '$hname','$alergies','$milkpowder','$specialfoods','$specactivy1','$specactivy2','$specactivy3','$specactivy4','$simage','$createdby','$createdon')"; $stmt=$pdo->prepare($sql); $stmt->execute(); $pdo = null; print '<script>alert("Saved");</script>'; header("location:../student/student_add.php"); } } Insert HTML <div class="col-md-9"> <div class="fileinput fileinput-new" data-provides="fileinput"> <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;"> <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&text=no+image" alt="" /> </div> <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div> <div> <span class="btn default btn-file"> <span class="fileinput-new"> Select image </span> <span class="fileinput-exists"> Change </span> <input type="file" name="simage"> </span> <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> Remove </a> </div> </div> </div> My display php code <?php if($_SERVER["REQUEST_METHOD"] == "GET") { $id=$_GET['id']; $sql ="Select * from tbl_student_master where id ='$id'"; $stmt = $pdo->prepare($sql); $stmt->execute(); while ($row = $stmt->fetch()) { $id =$row['id']; $sid =$row['sid']; $sname =$row['sname']; $nric=$row['nric']; $gender=$row['gender']; $dob=$row['dob']; $courseid=$row['courseid']; $pname=$row['pname']; $emailid=$row['emailid']; $hpno=$row['hpno']; $homeno=$row['homeno']; $offno=$row['offno']; $emergencyno=$row['emergencyno']; $address=$row['address']; $city=$row['city']; $state=$row['state']; $country=$row['country']; $hname=$row['hname']; $alergies=$row['alergies']; $milkpowder=$row['milkpowder']; $specialfoods=$row['specialfoods']; $specactivy1=$row['specactivy1']; $specactivy2=$row['specactivy2']; $specactivy3=$row['specactivy3']; $specactivy4=$row['specactivy4']; $simage=$row['simage']; } } ?> My Display HTML <div class="col-md-9"> <div class="fileinput fileinput-new" data-provides="fileinput"> <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;"> <img src="" alt="" /> <?php echo $simage; ?> </div> <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div> <div> <span class="btn default btn-file"> <span class="fileinput-new"> Select image </span> <span class="fileinput-exists"> Change </span> <input type="file" name="simage"> </span> <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> Remove </a> </div> </div> </div>
  2. So, I currently have a script (in beta mode, only works when the sun shines), that can upload an image and store directly in a mysql database (using the BLOB data type); the script is also able to retrieve the BLOB data and display them vertically on the page; I actually need to dsiplay them horizontally across the page instead. So currently the retrieved images are printed in this format: 1 2 3 4 5 6 7 8 and I need it to print this way: 1 2 3 4 5 6 7 8 sounds like a for loop somewhere... any takers on how to implement the feature?
  3. I'm trying to use phpMyAdmin to put a blob video into the database (for ease of handling), and for some reason when I put the video into the blob, and submit it, phpMyAdmin bounces back to the home page, and says "no change". Does anyone know what's going wrong in the file? I've done the same upload with the image preloader just fine, but when I go to do the video it errors.
  4. Hey, so to display an image from a database I was using $id = addslashes($_REQUEST['id']); $image = mysql_query("SELECT * FROM store_image WHERE id=$id"); $image = mysql_fetch_assoc($image); $image = $image['image']; header("Content-type: image/jpeg"); echo $image; That worked fine to return an image via matching the id. But I want to get ALL images from the table.. I tried this: $image = mysql_query("SELECT * FROM store_image"); while($image = mysql_fetch_array($image)){ $image = $image['image']; header("Content-type: image/jpeg"); echo $image; } But did not work.. what am I doing wrong?
  5. Hello, I am trying to save image in mysql table using blob. I am show you my code [form page and backend page for insertion], please let me know where i am wrong ? <!DOCTYPE html> <html> <head> <title>Forms</title> <link href="css/kendo.metro.min.css"rel="stylesheet"> <link href="css/kendo.common.min.css" rel="stylesheet"> <script src="js/jquery.min.js"></script> <script src="js/kendo.web.min.js"></script> <script src="js/kendo.upload.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#btnSubmit').click(function(){ $.ajax({ type: "POST", url: 'data/create_new_property.php', data: "buildername=" + $('#buildername').val() + "&projectname=" + $('#projectname').val() + "&files=" + $('#files').val(), success: function(data){ $('#status').html(data); $('#buildername').val(''); $('#projectname').val(''); $('#files').val(''); } }); }); }); </script> </head> <body> <div id="example" class="k-content"> <div> <ul class="forms"> <li> <input type="text" class="k-textbox" id="buildername" value="Builder Name" onblur="if (this.value == '') {this.value = 'Builder Name';}" onfocus="if (this.value == 'Builder Name') {this.value = '';}"/> </li> <li> <input type="text" class="k-textbox" id="projectname" value="Project Name" onblur="if (this.value == '') {this.value = 'Project Name';}" onfocus="if (this.value == 'Project Name') {this.value = '';}"/> </li> <li> <input type="text" class="k-textbox" id="location" value="Location" onblur="if (this.value == '') {this.value = 'Location';}" onfocus="if (this.value == 'Location') {this.value = '';}"/> </li> <li> <input type="text" class="k-textbox" id="budget" value="Budget" onblur="if (this.value == '') {this.value = 'Budget';}" onfocus="if (this.value == 'Budget') {this.value = '';}"/> </li> <li> <input type="text" class="k-textbox" id="propertytype" value="Property Type" onblur="if (this.value == '') {this.value = 'Property Type';}" onfocus="if (this.value == 'Property Type') {this.value = '';}"/> </li> <li> <input name="files" id="files" type="file" /> </li> <li> <input type="text" class="k-textbox" id="area" value="Area" onblur="if (this.value == '') {this.value = 'Area';}" onfocus="if (this.value == 'Area') {this.value = '';}"/> </li> <li> <button class="k-button" id="btnSubmit">Save Project</button> </li> </ul> <style scoped> .forms { float: left; } .forms li { margin-bottom: 5px; list-style: none; } .forms li > * { width: 400px; } </style> </div> </div> </body> </html> php code to Insert data in mysql <?php header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Methods: POST, GET"); header("Access-Control-Allow-Headers: x-requested-with"); mysql_connect("localhost", "root", "") or die("Connection Failed"); mysql_select_db("property")or die("Connection Failed"); $bname = $_POST['buildername']; $pname = $_POST['projectname']; $uploadfiles = addslashes (file_get_contents($_FILES['files']['tmp_name'])); $image = getimagesize($_FILES['files']['tmp_name']);//to know about image type etc $imgtype = $image['mime']; //$query = "UPDATE test SET password = '$password' WHERE name = '$user'"; $query = "INSERT INTO projects (buildername, projectname, img) VALUES('$bname','$pname','$uploadfiles')"; if(mysql_query($query)){ echo "updated";} else{ echo "fail";} ?> Please correct me where i am wrong. Thanks a lot for your time
×
×
  • 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.