Query Against Longblob Field
I am storing binary files in my database, I've tried to retrieve it using the following statement:
select from s_proc where contents = 'ksajfha'
...........
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Changing JPEG File Stored In LONGBLOB Field
I have no trouble storing a JPEG file in a LONGBLOB binary field along with other data stored in text, date, integer, and decimal fields on the same record. I have no trouble updating the non-binary data fields to correct typos or changed information, but I don't seem to be able to swap digital photos (JPEG files) when I need to change the photo.
View Replies !
View Related
Longblob To Bigint(13)
I want to migrate longblob to bigint(13) mytable idx|name| write_date(longblob) 1 | tom | 1234567890123 developer is java developer. so he use system time (in java long (int 13)) I want to sort by write_date so I use index in write_date but I can't because longblob so I want to change longblob to bigint(13) is if safety?
View Replies !
View Related
Longblob Data Type
actually what information is kept in longblob data type? i've tried to upload image and save it in longblob. is it only the file link saved in the longblob? if i move the location of the saved image, it won't be able to display when my page load, rite?
View Replies !
View Related
Selecting Images From LongBlob
I am currently running an images hosting website where images are stored in a mysql database (longblob) The upload works fine, but when selecting the images to show them it only works if the images are smaller than 1MB.. Attempting to view an uploaded image bigger than 1mb just causes to break. Any idea how to solve this problem so i can select/download bigger images from the database? Code:
View Replies !
View Related
Maximum Size For Longblob
i have a field as longblob and since longblob can take values upto 4Gb but my table shows the max of (Max: 2,048KB). im uploading files through this tables. i dont know how to upload files bigger than 2MB.
View Replies !
View Related
Storing Images As Longblob
I´m trying to create a php website that stores information in MySql. My problem is I can´t seem to insert images into the database. I´m using a form and all the information in the text fields is inserted all right, but the image I upload using <input type="file"> is not, it just inserts the name of the file, but not the file itself. My form has the enctype="multipart/form-data", and I´m using mysql_query to run the insert statement.
View Replies !
View Related
Compare Longblob With Binary Data
checking the data of a longblob for equality. assume = the `data` field is of type longblob. the following statement returns = the image records with equal data. SELECT * FROM `image` WHERE `data`=3D? how does mysql performe the test. does it check the length of the blob = before comparing the data, or makes it sense to add the length test as = follows SELECT * FROM `image` WHERE LENGTH(`data`) =3D ? AND `data`=3D?
View Replies !
View Related
Replication :: Issues With LongBlob Datatype
Has anyone ever had any issues with the LongBlob datatype and replication. I'm using 4.1.14 I got it working perfectly, it did thousands of queries and then when I did a show slave status. the sql thread was running but the I/O thread was not. I got the log_position and it's a longblob, microsoft word doc. huge binary string. I tried to stop slave; the skip_position = 1 thing, then start slave, but the I/O still wouldn't start up? I'm not sure how to get it back going or fix the longblob problem. I got no errors on the slave, the I/O is just dead, seemingly irreversable.
View Replies !
View Related
Query For Getting Top 10 In A Particular Field
I am trying to write a query which can display top 10 entries in a particular field with the count. for eg: If i have a field "Month" which has entries Jan thru Dec. There are about 1000 rows. Now, i want to find the top 10 months with the count say, Month | Count Jan | 20 Feb | 13 Mar | 12 so on... Has anyone worked on this?
View Replies !
View Related
Using A Field From One Db In A Query Of A 2nd Db
I have a page that has an address something like: [someserver.com?SID=23] SID is the 'SID' field of the 'subject' table in 'database1'. I use the SID in a query to pull out some data and display from database1. Within the subject.php page, I want to do a MYSQL query of 'database2' and display some of the data from it. One of the fields is 'CID' in the 'category' table. I don't want to include any data from 'database1' in this query, but since database1.subject.SID is equal to database2.category.CID, I figure I can use it to identify the 'category' in 'database2'. See Query 2 below. I realize that the problem is the 'WHERE c.CID=" . $_GET['SID'] . I don't know how to pull in the SID value from the URL to use in Query 2. In the first query, I did this: Query 1 (database1: tables- subject) mysql_select_db("database1")or die("Could not connect : " . mysql_error()); $qry1 = "SELECT SID from subject"; $results = mysql_query($qry1) or die("Query failed : " . mysql_error()); $SID = $_GET['SID']; I then echoed some information to display from database1, using SID as the identifier. Query 2: database2 (tables: item, bridge, category) mysql_select_db("database2")or die("Could not connect : " . mysql_error()); $qry = "SELECT title,url from item i left join bridge b on i.ID=b.ID left join category c on b.CID=c.CID WHERE c.CID=" . $_GET['SID'] . "order by title"; I hope that is clear enough and that someone can give me some tips on how to do this. It is unclear to how to data use from previous queries and/or the original GET Request in the URL to do another query.
View Replies !
View Related
Field In Multiple DBs Using Sql Query
I have 60 databases with identical structures and I'd like to change a field value for the same field in each DB. At the moment, I've crafted this code: UPDATE `jos_users` SET `username` = 'newName' WHERE `jos_users`.`name` = "Administrator" ; How can I modify this code so that each database will inherit this new username value? I've been trying to use SELECT but can't quite get it working.
View Replies !
View Related
Query For A Memo Field
I want to select records that have a defined string in a memo field. Could you please tell me how to do that. For example, I want to search for the records that have a string "playing game" in a field of memo (text field).
View Replies !
View Related
Field Format Query
I have had a program written for my company (we fundraise money for charity). Essentially it records donor information (names, addresses, phones, and donations). Part of the program's design was to improve my telemarketers collection of information whilst on the phone (ie. standardising the format of the fields for output/printing etc). So... my dilema is that the SURNAME field has the following rule applying Make first letter Uppercase then all following letters lowercase.....
View Replies !
View Related
Query Field For Underscore String?
I have a field that contains an underscore. How can I do a query for the underscore since I just found that underscore really doesn't find underscore it is a wildcard in mysql. I need to be able to query for the actual underscore. For example. Select Title where Title LIKE '10_%' doesn't give me what I want.....
View Replies !
View Related
Increment The Specific Field By 1 In A Query
I still do the process of incrementing a specific field in a stand alone apps by query 1: get its value query 2: update value +1 But, i realize that this is really a bad idea when this would be used in web applications... specially the database is in another webhost....(very slow response) i tried (using php function) Expand|Select|Wrap|Line Numbers
View Replies !
View Related
Query 3 Fields In Same Table As If They Were One Field
I have a very simple test table which I am using to try and get the query right: id | col1 | col2 | col3 | 1 | 3 | 2 | 3 | 2 | 4 | 3 | 1 | 3 | 2 | 1 | 1 | 4 | 3 | 2 | 4 | 5 | 3 | 1 | 3 | 6 | 3 | 1 | 3 | So the table contains and id field and 3 integer fields - each of the integer fields contains an integer between 1 and 4. What I want to achieve is the value of the most frequently occuring entry across the 3 integer fields, as though all 3 fields were actually one - in my example, this would be 3 as there ar 8 occurenecs. I will also require the lowest occuring value also, in this case it is 4. I cannot work out to query all 3 columns simultaneously to obtain my results - I have been looking at joins but cannot work out how to join within the same table
View Replies !
View Related
Update Query For Part Of A Field
I need to update part of a field in around 3000 rows of a table. In each case the field in question has text already in it but I need to add an extra bit of text to the start of each one. I've had a look on the web and have found examples that show you how to replace text in part of a field but haven't found anything about adding new text.
View Replies !
View Related
IN Query Showing All Records If Used With Same Field Twice
I have 2 tables programs and programType. programs has 5 records and programType has no records. When I run a query like "SELECT * FROM programs where id in (select programid from programType) and id in (select programid from programType)" I get all records But When I try to run "SELECT * FROM programs where id in (select programid from programType)" Then I get no records.
View Replies !
View Related
How To Form Query When Field Name Has Spaces?
I'm doing a database for a dog-rescue group, and their info is being written by Front Page to a CSV file. Finally got an import CSV to MySQL to work. But all 160 fields have field names with numbers, spaces, apostrophes, question marks, etc. I really don't want to hack into the source program to make the fields "nice" for MySQL if I can avoid it. Here's a sample ... SELECT * FROM appforms WHERE appforms.[18_Sex_of_ Dog_you_want?] LIKE 'female'; The WHERE clause needs something ... and I've tried all kinds of variations of quotes, etc. Don't know if the brackets are right either. Easy enough to test with the Query Browser, but I've run out of ideas!
View Replies !
View Related
Query: It's Possible To Retrieve Only Numbers From A Field?
How to retrieve only numbers from a field? select firstname, address from `acme`.`anytable` where idanytable=100; +-----------+--------------------+ | firstname | address | +-----------+--------------------+ | ERICKA | RUA B NR 50 AP 202 | +-----------+--------------------+ select firstname, onlynumbers(address) from `acme`.`anytable` where idanytable=100; +-----------+---------+ | firstname | address | +-----------+---------+ | ERICKA | 50202 | +-----------+---------+
View Replies !
View Related
Date Field In Mysql Query
Just after a bit of advice or guidance on the best way to go about an issue i have.. At present i have a simple user form with drop down lists for the user to enter a date. (eg. 1,2,3, - Jan, feb, mar, - 2006,2007 etc..) as -$day -$month- $year... All other input areas on this form are text and will go in a Varchar fields so will not be an issue... My query is what is the best way to handle this date, and how..? I undestand Mysql needs the date as yyyy mm dd to be in a date field.. Im just really unsure of how to put my format date in to a date field on the table and query it out so it displays in my format again.. Ive done quite of bit of searching for this and seen many suggestions including using INT and Varchar fields so i am really confused as the best and correct way to go about this..
View Replies !
View Related
Query Returns Integer As Character Field
Not sure where I've gone wrong here but I have a query selects records via a left join and I'm atmysqlting to set a column in the query as integer and default it value to zero. I'm also executing this query through the 3.51 odbc connector.... I thought I'd mention this but don't think it has anything to do with the problem. select concat(lastname,' ',firstname) as custname,'' as worktype,'' as appointment,hphone as phone,custid,0 as booked_id,0 as booked_by,'' as booked_stamp from customers left join bookings on bookings.booked_by=custid where booked_by is null order by lastname,firstname asc When the query executes the records are returned properly but the booked_id and booked_by fields are being set as character type when they should both be integer.
View Replies !
View Related
Can You Use A Boolean Field Within A Table To Evaluate A Query?
One quick question. I want to build a query like this: SELECT * FROM <table> WHERE <condition> Where <condition> is a boolean field in the table being accessed. I assumed in the construction of the query that simply placing a boolean-type field in the query after WHERE would cause the MySQL engine to only return the rows where the field is TRUE. Please let me know if this is correct, and will work.
View Replies !
View Related
Create MySQL Select Query From The A Field Using SUBTRING_INDEX
Is it possible to create a MySQL query to do the following. Extract from TABLE.field, which is defined as text, containing either NULL, number (e.g. 54) or range of numbers (e.g. 70-95). Then use the extracted number within a WHERE clause I have looked into using something like SELECT SUBSTRING_INDEX(table.field, '-', 1); Problem is I don't know how to use this within the WHERE clause.
View Replies !
View Related
How To Construct Query For Results With Limit (Grouped By Values In Another Field)
Field 1 : GroupName Field 2 : IndexNumber The sample data could be {(HR, 1), (HR, 3), (HR, 5), (MANAGER, 10), (MANAGER, 12)} I wanted to pick the first two values for each GroupName sorted by IndexNumber ascending. So if I wanted 2 results for each GroupName, the result would be {(HR, 1), (HR, 3), (MANAGER, 10), (MANAGER, 12)} This will exclude the third set of data (HR, 5).
View Replies !
View Related
Retrieve Field Value When Submitting To Table Auto Increment Primary Field Value
In my form, I write to four fields in the table, (fields 2,3 4 and 5), which creates a new record. the first field of this new record is an auto-incremental field, giving a unique id. How can I write to the table and at the same time retrieve that unique id accurately, even if more than one person is performing write tasks simultaneaously? My first thought is that if I grab the previous records id and add 1, then this may not match my newly inputted record, given that it may take a few minutes to add the record and someone else could have been there before me with a different record. (I hope that makes sense). Then I thought that on opening the form, it could write to a new field inputting my loginID. Then I can retrieve the unique auto-increment number before then filling out my form and over-writing the loginID that I had previously entered. Sounds too convoluted to be the best way.
View Replies !
View Related
Extracting Field Data And Putting Each Field Into A Shell Variable?
In a MySQL query on the database (one table with 15 variable length fields, I want to put each field into a Bash variable so that I can handle each field as an entity. The query I have is something like this: mysql -e "use $database; select field1, field2, field3..., from Table1 where fieldN like '%something%';" can I / How do I do something like: mysql -e "use $database; select field1,..., var1=field1, var2=field2,....;" do stuff with var1, var2..., done
View Replies !
View Related
Can I Store The Sum Of Row's Child Rows' Field In A Parent Field?
Sorry if this has been posted before; I am not sure what to search for. I have a table of users, `users`. In the table `users` there is a row which stores clicks, `users`.`clicks`. Each user has it's own referrer, `users`.`referrer_id` which refrences the referring user's id. In the referring user's row, I would like a field to store referral clicks, `users`.`referral_clicks`. I would like `users`.`referral_clicks` to be updated each time that a child user's `users`.`clicks` field is changed. Is this easily possible in MySQL?
View Replies !
View Related
Regular Expression :: Search In One Field Concatenate Result In Other Field
Here is a tough one and it might not be possible but I hate to give up without a fight: I'm trying to make a query that runs through a database and searches for a regular expression in one field, then concatenates what it matched to the end of another field. Is this possible or do I have to concatenate the whole field? Can you use regexp with replace and concat at all or is it only used in the where clause? Normally I'd use a program to hold the value it matched and then run it in a different line but for this I need to use only mySQL. It kind of implies a reversed syntax because it needs to search for the string before it updates.
View Replies !
View Related
How To Convert A Varchar Field Into Proper Mysql Date Field?
I have a database in which the date is stored in varchar field in a following format: d-m-Y (06-08-2007), now the problem is that I want to change that field into mySQL date field as well as convert my older dates into MySQL date format i-e Y-m-d (2007-08-06).. There are about 300 old entries..is there a way I can do that automatically without manually re-entering the dates again?
View Replies !
View Related
Field Not Updating Using CONCAT() Function When Field Is Empty
i have used the mysql CONCAT($existingvalue, $newvalue) function as part of an update query where the input given is suppose to concatenate with the existing value of the field in the database. this works only when there are value/s in that field, when there is know exising value in the field the update query does not work on that field. how ever update on any other field works fine(not using the function) at the same time.
View Replies !
View Related
Using Field Contents As Needle To Search Haystack Field
I have two tables. One has a serial number field, the other has a comments field that may or may not contain a matching serial number somewhere in the field. I know this is a bad example, but, I need to be able to do a search like this: Select * from frog a left join turtle b where b.comments like "%(a.serial_number)%" I need to end up with only the records where one of frog's serial numbers appear in one of turtle's comments fields. I've tried looking a number of different solutions (variable assignment, Locate string with if statement) but I cannot get anything to work, or find any good examples of this. I know how to do it with PHP, but I'd like to stay in MySQL.
View Replies !
View Related
|