Jump to content

Thierry

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

About Thierry

  • Birthday 12/10/1987

Profile Information

  • Gender
    Male
  • Location
    Netherlands

Thierry's Achievements

Member

Member (2/5)

1

Reputation

  1. I got a table with some IDs in it, and using (example, field1 is an ID, field2 is a name) SELECT table1.field1, table1.field2 FROM table1, table2 WHERE table1.field1 = table2.field1 ORDER BY table2.field2, I can order by the name of records in table 2 while I only got the ID in table 1. That all works fine, but if the table1.field1 (ID) is empty (which it can be, its not the key) then, instead of simply showing no name, it doesnt retrieve the record. I need it to retrieve the record regardless of its contents, if its empty, it should show no name. Any ideas?
  2. Never mind, seem to have found it again, forgot about the whole table_1.id = table_2.id :p
  3. I got a table with a list of names (and their ids) and another table which has a field that contains some of those IDs. When I want to ORDER BY the IDs in table 2, it (naturally) orders by number. (1,2,3...). What I want, is it to order by the names from table 1 instead althought only the IDs are in table 2. It was something in a query with AS but I cant seem to find it again. Any ideas?
  4. I am building a user interface PHP website which uses a MSSQL database to store stuff. When I was using Access as my interface, the Access files where only a couple MB, but now the log file has grown to 8Gb! I dont know why, I haven't uploaded 8GB or anything near that at all....
  5. Here, I use this to upload to a MSSQL text field, can hold 3gb //--------------------------------------------------------------file---------- $fileNameTemporaryS = $file; $fileNameClientS = $file_name; $fileSizeS = $file_size; $fileTypeS = $file_type; $fileNameClientS = str_replace(' ', '_', $fileNameClientS); // if ($file == "") { echo ""; } else { // $fd = fopen ($fileNameTemporaryS, 'r'); $sizeB = filesize ($fileNameTemporaryS); $contB = fread ($fd, $size); fclose ($fd); $data = base64_encode($cont); $fileencoded = chunk_split($data,20,'\'.\''); } //----------------------------------------------------------------------------------- Then simply get a query to upload $data to your text field, you can also upload filesize, name and type information This will upload any file, any format, it will Base64_encode it, and then put all the text in the field This will download it again: list( $data, $filename, $filetype, $filesize) = mssql_fetch_array( $result ); chunk_split($data,20,'\'.\''); if ($filesize == "0"){echo"This file doesnt exist. <a href=\"javascript:history.go(-1)\">Back</a>";} else{ header( "Content-length: $filesize" ); header( "Content-type: $filetype" ); header( "Content-Disposition: attachment; name=$filename" ); echo base64_decode($data); } mssql_close( $link ); exit;} ?>
×
×
  • 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.