Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem.
The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table.
How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem. The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table. How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
Dynamic Menus
how to have dynamic menu, say one option is selected from the first menu, and that option changes the 2nd menu options. ? yeah i have seen it work in JavaScript, (onchange) but what would the syntax be in php ?
Dynamic Menus
<?php include('./common_db.inc'); $link_id = db_connect(); mysql_select_db("test_db"); ?> <form name=carform action= <?php echo $_SERVER['PHP_SELF']; ?> method=post> <?php $query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from CQ_data ORDER BY make_id"); echo '<select name=make onchange="document.carform.submit()"'.">"." "; if (!isset($make)) { echo '<option value=null selected>Choose a Make</option>'." "; } while(list($make_id) = mysql_fetch_row($query)) { echo '<option value='.$make_id; if (isset($make)&& $make_id == $make) { echo " selected"; } echo '>'."$make_id".'</option>'." "; } echo '</select>'." "; echo '<select name=model onchange="document.carform.submit()"'.">"." "; if (!isset($make)) { echo '<option value=null selected>Choose a Make First</option>'." "; } else { $result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from CQ_data where make_id='$make' ORDER BY NAME"); echo '<option value=null selected>Choose a Model</option>'." "; while(list($model_id) = mysql_fetch_row($result)) { echo '<option value=' . $model_id; if ($model_id == $model) { echo " selected"; } echo '>$model_id</option>'." "; } } echo '</select>'." "; ?>
Dynamic Drop-down Menus
I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields: Area Name Day start time (the time of day bookings can begin e.g 9 AM) Booking Time Slot (the length of time for each time slot e.g 30 mins) Day Finish Time (the time of day bookings must finish e.g 6 PM) What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past. I have looked at several methods for doing this but cannot decide what would be suitable. Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times. My questions are these: Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?
Dynamic Pull Down Menus
I was wondering if a kind person off here could point me in the right direction. I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu? For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.
Update Mysql Blob With Another Blob Using Php
I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or convert to Hex or something. I've tried a few things but can't quite get it. Here is simplified code. mysql_select_db($dbname, $connection); $query = "SELECT blobthing FROM mytable WHERE id = 1;"; $results = mysql_query ($query, $connection); $row = (mysql_fetch_assoc($result)); $varblobthing = $row['blobthing']; //put the blob in a variable $query = "UPDATE mytable SET blobthing = ".$varblobthing.", WHERE id = 2;"; mysql_query ($query, $connection);
Menus In Php
currently i have web application in php which has its menus created in javascript. if we do view source on the page, it displays all the javascript which is obvious n natural. but it displays all the file names of php too which are related with those specific menus. dont we have any way by which we can prevent it. as an alternate i m thinking of creating the menus also in php so that the names of my files dont get visible to the user from the security point of view. is it sensible to do so because it will be an extra overhead to the system for creating the manus everytime.
Sticky Menus
It's common courtesy to ensure that a form with validation problems reposts with the fields still filled in, so the user doesn't have to start over, by echoing the variables in the Value attribute of the text fields, but I also want to have a drop-down menu to be sticky and retain its selected state when the page reposts.
PHP And Drop Down Menus
I've looked through the forum rather extensively and my qestion is similiar to the question by Brian_F and answer by "saintaw" a couple of days ago in this forum. I already have a functional page that has several dynamic drop-down menus from which the user selects a topic of interest. My question is how to reference their choice from the drop down menus in order to display the results of their choice. I would like the user to be able to choose a subcategory with one of the drop down menus and then be able to view the questions related to that subcategory. I currently have a nested for loop which displays the categories and subsequent drop-down menus for each category, and I'm using PHP and MySQL to do the dirty work. code:
Php And Drop Down Menus
I have a question about PHP and drop down menus. Should I be using PHP for my drop down menus or should I be using java script? I have a whole contact form that is programmed in PHP, but I have never done a drop down menu with PHP, is this possible? If anyone knows of any great drop down menu tutorials in PHP.
Selecting Using Pull Down Menus ??
Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on. But what i got stuck in was creating an ALL search does n e one know how to do them ?
Dependent Select Menus
I would like to create a form in which a 2nd select box appears depending on the value selected in the 1st select box. The values of the 2nd select box will come from a database. My question is how to create this in php? One way is to re-load the page depending on what's chosen in the first box, or alternatively to use frames or an iframe? Is there another, better way that can dynamically change the initial page?
Getting Data From Drop Down Menus
I have a drop down menu and I'm trying to find out which option they have pressed. I need to use the $_POST method to do this. Below is what i've written so far, but it's showing every time the messages: "You don't have enough points" AND "you gained blah blah exp" I've blocked out some of the stuff that calls up files and stuff, just for security reasons Code:
Using PHP And MySQL To Populate (select) Menus
I am a newbie to php *gasp* and I am trying to make a <select> drop down menu, but I want the menus populated by information from a field in my database. There are a bunch of entries in the field MUD, that are identical......I would like the menu NOT to repeat identical names. EX... Each name only once, even though it is in the database many times.
Drop Down Menus And Form Processing
I select a client from the first drop down menu, then a list of events for that client is shown in the second drop down menu. I then want to select the event from the second drop down and automatically go to a form I built "editevent.php3" showing information echoed from mySQL for that event. I have started the code, but know it is not complete. Code:
Insert Date Using Drop Down Menus
I know how to insert a date by filling in a field but I don't know how to do it using a drop down menu. One menu being month, another the day and the last the year. Any code snipplets I can disect and play with or tutorials on this?
Drop Down Menus And Mysql Insertion
I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40 I've created the drop down boxes and it works pretty well: Code:
Add Data To A Database Using Dropdown Menus?
lets say i had a database with a table called admin hacks and another table called user hacks,and both tables had feilds called name and id now what i want to be able to do is create a submit form with a drop down menu saying the table names mentiond above, also the form will have a field called name. now lets say a user slected admin hacks from the drop down menu and enterd jack in the name, how would i get the data in that submitted form to be inserted into the correct database table, so jack should now be in the table called admin hacks also lets say someone selected user hacks and entered jon how would i do the same for that?
Values Into Radio/check And Drop Down Menus
I am attempting to create an update form where the current fields in the table are populated into input boxes and then can be altered where necessary. I was wondering if it is possible to pre check radio buttons, check boxes and pre populate drop down menus based on the results currently in the table. eg. if the gender of a person is male then the radio button will be pre checked as male. How would this be done.?
Php And Informix Blob
I am running PHP 4.2.3 with Informix Dynamic Server 2000 Version 9.20.HC. I am trying to insert some text into a blob space and I get a -609 error. here is a code snipit. $textid = ifx_create_blob(0,0,$strText); $blobidarray[] = $textid; $db_query = "insert into assignment_info (user,emp_ext,status,hardware_id,emp_assigned_id,d esc) values('$strEmp_Name','$strEmp_Ext',Ƈ','$strSubCa tegory',Ɔ',?)"; $result = ifx_query($db_query, $connection, $blobidarray); if (!$result) { echo ifx_errormsg(); } else { ifx_free_result($result); } I don't what I am doing wrong. Either the php is bad or my creation of the blob space and the column are bad.
PHP Inside A BLOB?
is this possible at all? would make things a lot more flexible but i don't know if this is parsed at all after getting some html code from a mysql blob.
PHP, Images & Blob Field
I looked everywhere and I have found nothing on the subject of using php to insert an image into a Blob field of a MySQL db, this is possible isnt it?
BLOB+PDF : How To Display In Pop-up Window...
I have a table in my db that can store BLOB. Actually the BLOB was came from PDF file that uploaded by the user. How can i retrieve the BLOB file as a PDF file in pop-up windows. I have try another format like .gif and .jpg and it display correctly. But with PDF file it will as me if i want to save the file as postscript.
Storing Image Into BLOB
I am having one problem which is that: - I can upload and store image into BLOB field normally on one machine-winXP where installed Apache 2 and php 4.x - exactly same php code not functioning on the another machine-winXP where running Apache 1.3 and php 4.x What is problem, can I have help from some one? When I check the data stored in BLOB field (by means of saving into Desktop using MySQL Control Center) it were always stored 77 bytes of image/jpeg data, and 66 bytes of image/bmp files!
How To Get A Blob Image Out Of A Record?
Iam posting this after trying many tutorials in the NG and failing to retrieve the blob out of a record. So please bear with me before before you pull the water hose or flame throwers ...... I can upload a Jpeg image file perfectly. Iam using this snippet to do that.. <!-- addpic.php snippet !--> .... $file = fopen($_FILES['pict']['tmp_name'], "rb"); $pic = fread($file, 5000000); // mysql_query(INSERT .... code goes here MySQL Admin shows that the picture I have uploaded 430KB as 428KB, not sure this matters. Now I want to get the image displayed inside my html page <!-- html code goes here ----> <img src="getimg.php?i=8" height=244> <!-- here is the code snippet for getimg.php to extract the blob file --> ($row = mysql_fetch_array($result)) $data = $_GET[$row['pic']]; header("Content-type: image/jpeg"); include $data; // echo $data;
Accessing BLOB From Mysql Db
hi, i m facing a problem in properly accesing BLOBs from mysql db. when i display an image stored in the blob field it show some absurd characters. i think it is the problem of properly telling browser the mime type of image of blob field. that is exactly what my problem is. i do not know how to do that .
Parsing PHP Sourced From Blob
When a php statement is "part" of a markup snippet in a mysql database table field, what must be done to have the php parse in the document. The php tags are being displayed
Read Blob From Mysql
I do have a mysql database with a BLOB column. What is the proprest way to read this column ?
Reading From A Blob Or A File Which Is Better?
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically?
Blob Data - Timeout Issue
Hello, I have success when uploading a binary file to a mysql "blob" type when a file is not larger than 2.5MB. When uploading a file >2.5MB, I get an error of MySql server has gone away or cannot allocate file and I get "Couldn't Add File to Database" . I've read the manual on the error, but having checked all the settings i.e. max_allowed_packet=16M, php.ini settings of upload_max_filesize=16M, post_max_size=16M, max_execution_time=3600 and also httpd.conf timeout= 3600 and the error still persists. Is it mysql, php, apache or the script? HTML: <form enctype="multipart/form-data" name="frmUploadFile" action="grabfile.php" method="post"> <INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="16000000"> The script: grabfile.php <? $dbServer = "localhost"; $dbDatabase = ""; $dbUser = ""; $dbPass = ""; $fileHandle = fopen($fileUpload, "r"); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); $sConn = mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't connect to database server"); $dConn = mysql_select_db($dbDatabase, $sConn) or die("Couldn't connect to database $dbDatabase"); $dbQuery = "INSERT INTO myBlobs VALUES "; $dbQuery .= "(0, '$strDesc', '$fileContent', '$fileUpload_type')"; mysql_query($dbQuery) or die("Couldn't add file to database"); echo "<h4>Upload of $fileUpload_name is complete.</h4>"; echo "The details of the uploaded file are shown below:<br><br>"; echo "<b>File name:</b> $fileUpload_name <br>"; echo "<b>File type:</b> $fileUpload_type <br>"; echo "<b>File size:</b> $fileUpload_size <br>"; ?> Any suggestions?
TEXT Or BLOB Field Problems
When I use a form and php to input long articles (in a TEXT field) into a mysql table, the code runs smoothly (i get a thank you message). However, the record isnt always put into the table. If I input only the varchar fields into the form, then it works. But if I also try to append the TEXT field then it doesn't work from a web form. It works sometimes but not all fo the time. Why does this only work sometimes, do i have to do something witht he code? change the database?
BLOB Data As Src For Thumbnail Creation?
I have images stored on my MySql database as Binary "BLOB" filetypes. I want to make thumbnails of these files to display. I know how to create thumbnails using paths and image names of .jpg files. But I do not know how to use Binary"BLOB" image data to create them. Do I have to encode the data in a certain format for the getimagesize(), ImageCreateFromjpeg() and imagejpeg() functions to work? Or does this have something to do with specifying a MIME type? I don't know how to get the functions to read the BLOBs.
Iterating Through Tables With Blob Parts
I'm probably crazy for even trying this but I'm trying to make a script that will iterate through my databases, iterate through all the tables, and show everything on one page in forms that allow me to change the data when I hit the submit button. Blogs are displayed as links to image.php?id=$id along with browse buttons so new images can be uploaded. The idea is to make an idiot proof way for artists to change their web databases without having to use phpadmin. Its not that hard when all the tables have ids that are the same. I simply find the highest id from the first table, then iterate through the ids and call each table for every id. $sql="select * from $table where id=$id"; Some of these art graphics are quite large, so I wanted to break them up for easier downloading. The trouble started when I broke the blobs up into 64k parts and gave each blob a master id. for example: imagemeta image id=1 id=1 masterid=1 id=2 masterid=1 id=3 masterid=1 id=2 id=4 masterid=2 id=5 masterid=2 This is how it was done at However, it seems kind of crazy to me because the image ids have nothing to do with the imagemeta ids; I can't just iterate through the ids and assume that all the data in each id corresponds to data in other tables with the same id. So I tried it like this: imagemeta image id=1 id=1 part=1 id=1 part=2 id=1 part=3 id=2 id=2 part=4 id=2 part=4 This seems crazy too, because you end up with multiple ids with the same number in the image table. Either way, it gets pretty complicated. Is there any preferred, definitive way this should be done ? Right now I'm working on doing it the first way (above). But here's the complicate way I have to do it: first,I iterate through the masterids in the first image table, learn which ids it holds and then iterate through the other tables while checking to see if each table has a master id. If it does, I use the master id to call up the image. if it doesn't I use the ids I found in the first table to call up the metadata.
Insert And Select Images (BLOB) From DB2 Using PHP?
DOes anybody have a working example of how do make this work? I've tried everything I could find, Clara patch, many non-working examples using pack, baseencode, addslashes, str_replace, bin2hex, hex2bin, for read only, using different db2 dataypes blob,clob etc.....I'd post code but I've tried too many to list. just an example would be excellent. I've been trying 2 days now. I know there is a php bug report 25118 http://bugs.php.net/bug.php?id=25118 If I use the DB2 datatype of clob, I can get the insert to work (at least not produce errors), but getting anything useful back out is pointless. It seems I can only retrieve 4k of crap (or mabey the insert only put 4k there). I can read the thing back to a file and look at it, the first 4k of stuff matches what I input (in this case a 26k jpeg file), but after that it looks just like random crap including some php code (pretty funny), so it appears to be padding the file to the proper length with junk. datatype of blob produces error on the insert no matter what I try Any working examples out there? Please please...I really could use some sleep. PS, storing on filesystem and putting pointers in DB is not an option in this case.
How Do I Get Image Data Into A Blob Field
I am trying to get image data into a mysql field (like a simple jpg). Does anyone have a quick tips on how to submit an image (through an html form) process via php and insert into a mysql blob field?
Write A File From MySQL BLOB
I am storing a BLOB in a MySQL database, and want to know how to write it out again to a file on the server, in a specified location, in php.
Mysql BLOB Image Resize
Having a small nightmare trying to resize an image that is stored in a blob. Anyone had any experience with this? I can find is some vague reference to image magic pulling an image from a blob, but that's about it. I DON'T want to have to create a file though to display an image, just pull it from the DB and display it via PHP which is what it currently does.
Apostrophe Or Single Quote In A Blob
i use an apostrophe or single quote in a blob and it returns an error. any message without the apostrophe passes on smooth. is there some escape character or something i need to use for this one?
Display Text In Firebird BLOB
I have a Firebird 2.o Database. When I display the text content of a BLOB field, I get the following result. { tf1fbidisansiansicpg1252deff0{fonttbl{f0fswissfprq2fcharset0 Helvetica;}{f1fswissfprq2fcharset0 Calibri;}{f2fnil MS Sans Serif;}} {colortbl ; ed0green0lue128;} viewkind4uc1pardltrparqclang1033f0fs22 DURBANVILLE CONGREGATIONpar DEDICATED 28TH NOVEMBER 1999par. I use ibase_blob_echo to return a result. How can I get the result to display witout the rtf characters.
PhpMyAdmin InnoDB Insert Into BLOB?
Anyone ever used InnoDB storage engine and try to insert into BLOB fields with phpMyAdmin. For some reason it won't do it, due to some guess at a row count?
Determining Mime Type Of MySQL Blob?
Is there any PHP function that will allow me to determine the MIME type of a blob stored in MySQL? Specifically, if I'm storing an image as a blob in MySQL, is there any PHP function that can determine whether it's a gif, jpeg, png, etc?
Word Doc Stored As BLOB In MySQL - Retrieval ?
I've stored a word doc as a LONGBLOB in MySQL. To retrieve the contents of the file, I have a script which creates a temporary file, writes the contents to the file, then auto-redirects the browser to the .doc file; the browser then prompts the user to download the file. The original .doc, which was uploaded to MySQL and the .doc downloaded from the temp file are the exact same size. However, MS Word won't open the downloaded .doc file, saying that "The document name or path is not valid" Anyone else run into this problem getting Word docs from MySQL?
Resizing Uploaded Images Before Inserting As BLOB
I have a system that uploads images as BLOBs in a database. I also have a function that I use to resize uploaded images before saving as files. I would like to combine these two by resising the images before inserting them as BLOBs. My problem is that (apart from being new to file stuff) my resize function returns a Resource ID which of course is not the same as the file handler that was passed to it, it's a reference to an image created with imagecreate(). The resize function usually uses imagejpeg() for the final step of creating the file, is there something similar I need to use to return a file reference for inserting into the database? This is the bit that inserts the resized image into the database.. $thisImage = createImageFromSource($fm_image,"",$imgWidth,$imgHeight,"low"); if($thisImage){ $imageData = addslashes(fread(fopen($thisImage, "r"), filesize($thisImage))); doQuery("INSERT into productImages(fileData,fileSize,fileType,productID ) VALUES('".$imageData."','".$thisImage_size."','".$thisImage_type."','".$fm_productID."');"); } As you can see, I need createImageFromSource() to return a file handler into $thisImage that can be used by the fread and fopen functions. At present createImageFromSource does this (GD 1.6.2): $src = imagecreatefromjpeg($source); $dst = imagecreate($tn_width,$tn_height); imagecopyresized($dst, $src, 0,0,0,0, $tn_width, $tn_height, $width, $height); if($destination!=""){ imagejpeg($dst, $destination, -1); }else{ return $dst; }
|