Jump to content

franzwarning

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Posts posted by franzwarning

  1. After doing some research, I think I can do it like this:

    <?php
    $result    = ibase_query("SELECT blob_value FROM table");
    $data      = ibase_fetch_object($result);
    $blob_data = ibase_blob_info($data->BLOB_VALUE);
    $blob_hndl = ibase_blob_open($data->BLOB_VALUE);
    echo         ibase_blob_get($blob_hndl, $blob_data[0]);
    ?>

    But what is ibase? Is it like mysql_query but for BLOBS?

  2. Here is my current code to display files from the end to beginning :

    <?php
    function func() {
    	$date = date("Y-m-d");
    	$picarray = array();
    	$userarray = array();
            $handle = opendir ('pqimages/'.$date.'/');
            while (false !==($file = readdir($handle))) {
                if($file != "." && $file != "..") {
                    $picarray[] = "http://blah.com/pqimages/".$date."/".$file."";
                    $userarray[]= "pqimages/".$date."/".$file."";
                }
            }
            sort($picarray);
            sort($userarray);
            closedir($handle);
    	$json_array = json_encode($picarray); 
    	echo $json_array;  
    	}
    	func();
    ?>
    

     

    How could I change this from end to beginning  for ($picarray)?

     

    Cheers,

    George

  3. Hello,

     

    How could I resize the image to 320x480 before it is uploaded. Here is the code for the upload:

    <?php
    require("connect.php");
    
    $query = mysql_query("SELECT * FROM items ORDER BY id DESC");
    if (mysql_num_rows($query) > 0) {
      $row = mysql_fetch_assoc($query);
      $id = $row['id'];
      $id++;
    echo $id."<br>";
    
    
    $username = $_GET['user'];
    $dateofupload =  date("Y-m-d");
    $uploaddir = './pqimages/'.$dateofupload.'/';
    $file = basename($_FILES['userfile']['name']);
    $uploadfile = $uploaddir.$id.".jpg";
    
    
    
    if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)){
    
    echo "http://randomaydesigns.com/pqimages/{$file}";
    $userid = mysql_query("SELECT * FROM users WHERE username ='$username'");
    while ($row2 = mysql_fetch_assoc($userid)){
    
    $userid = $row2['id'];
    
    
    $updateuserlastupload = mysql_query("UPDATE users SET lastupload='pqimages/".$dateofupload."/$id.jpg' WHERE username='$username'");
    
    $updateuser = mysql_query("INSERT INTO items VALUES('','$userid','1','i','','','pqimages/".$dateofupload."/$id.jpg','0','a','$dateofupload')");
    }
    }
    
    
    }
    
    ?>

    Cheers,

    GEORGE

  4. Hi,

     

    I'm having trouble carrying items between two files. The problem is that it works too well. Whenever I include a php file that echos something, the other php files echos the same thing. What are some ways to stop this, but still have access to the variable.

     

    Thanks,

    GEORGE

  5. Hi, I have this php code to display the url of the files and it works fine, it just has a weird order when it is echoed out.

    Here is the code:

    <?php
    	$date = date("Y-m-d");
    	$picarray = array();
            $handle = opendir ('pqimages/'.$date.'/');
            while (false !== ($file = readdir($handle))) {
                if($file != "." && $file != "..") {
                    $picarray[] = "http://randomaydesigns.com/pqimages/".$date."/".$file."";
                }
            }
    	$json_array = json_encode($picarray); 
    	echo $json_array;  
    ?>

    There are three files in the folder and they are 33,34,35.jpg it displays them like 33,35,34.jpg

     

    Any Recommendations?

    Thanks,

    GEORGE

  6. Hi, here is my script to get the usernames of a few members. I'm trying to encode it using JSON.

    <?php
    require("connect.php");
    
    
    $date = date("Y-m-d");
    	$picarray = array();
            $handle = opendir ('pqimages/'.$date.'/');
            while (false !== ($file = readdir($handle))) {
                if($file != "." && $file != "..") {
    			$getusername = mysql_query("SELECT * FROM users WHERE lastupload='pqimages/".$date."/".$file."'");
    			while ($row = mysql_fetch_assoc($getusername)){
    
    			$usernames= $row['username'];
    			$people = array();
    			$people[] = $usernames;
    
    			echo json_encode($people); 
    
    			}
                }
    
    
            }
    
    
    ?>

    the only problem is the output:["mumford"]["franzwarning"]["tetris"]

    when it should be: ["mumford", "franzwarning", "tetris"]

     

    any recommendations?

    Thanks,

    George

  7. Hi, I want to be able to click on the photo and go to the next one in a folder. I have this code already, I just am not quite sure how to finish it.

     

    -George

    <?php
    $count = $_GET['count'];
    $dir = "images";
    $names = array();
    $handle = opendir($dir);
    while ($name = readdir($handle)){
    if(is_dir("$dir/$name")) {
    	if($name != '.' && $name != '..') {
    		echo "directory: $name\n";
    	}
    } elseif ($name != '.DS_Store' ) {
    
    	$names[] = $name;
    }
    
    }
    closedir($handle);
    $numberofitems =  count($names);
    $numberofitems--;
    
    
    if ($count <= $numberofitems){	
    
    
    echo "<p>";
    echo "<img src='images/".$names[$count]."'>";
    
    } else {echo "end";}
    
    
    
    ?>

     

     

×
×
  • 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.