Jump to content

mr_pablo

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by mr_pablo

  1. Hey folks! I am looking to build a small adventure game in PHP and the key to this will be a 3x3 (or possibly bigger) grids of squares, with the user situated in the centre. I therefore need to be able to figure out the co-ords of the surrounding squares. Presumably I will need to define the size of the master grid, then using the co-ords of the current square (defined from a database containing the users location), calculate the co-ords for the surrounding 8 grid squares. Has anyone had any experience with this? Where should I start? (Maths isn't my strong point tbh, but I can pick things up quickly) Thanks in advance! EDIT - in case it wasn't too clear, the "world map" would be something like 1000x1000 squares, but the player can only see the 3x3 grid at there location.
  2. SOLVED - Removed the "includes" and put my DB connection data inside the display file. Seems you cannot have includes, even if the included files have nothign but php code.
  3. i really need this to work with LONGBLOB. i set up an upload php script, which works fine, yet still the display script will not show my image, i have tried both image/jpg and image/jpeg but neither work. my data exists in the DB as i ican pull out and view the raw BLOB, yet nothing i try will make it show up. this is getting rather fustrating and i need it fixed today. are there any settings in my PHP.ini or apachae server conf that i could change to try fix this?
  4. viewing image properties gives the same as before, 0 x 0 dimensions, 0 bit depth, 123 KB (125,662 bytes) (correct file size) but oobv no image being displayed. cannot view page source as its just trying to display an image (as the http header is set to jpeg. i tried googling that b"{} and i cannot find any reference to it... are you sure its even PHP code?
  5. Sorry, I edited my previous post, your b"{} thing didnt do anything
  6. Oh yes, my table row is video_content but my test file is simply a jpeg image, as my video files are not ready yet (a friend is editing them somewhat for me) I tried adding the amendment you made, but I still get the same results. Like I said, this code is 100% the same as other image BLOB retrieval code snippets on the 'net, yet mine does not work. Could my storage as LONGBLOB be the problem? or maybe the fact I uploaded the file in phpmyadmin (it has no file type etc assigned to it, unless thats coded in the BLOB)
  7. I am trying to display an image (later on it will be various file types) by pulling a BLOB string from a MySQL DB, yet I cannot get the image to display, even though my code looks like everyone else I see on the Internet. <? include "includes/config.php"; include "includes/opendb.php"; $id = $_GET['id']; $sql = "SELECT * FROM video_index WHERE video_id = '$id'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $content = $row['video_content']; header("Content-type: image/jpg"); echo $content; ?> The config and opendb php files are to connect to the DB. If I try going to localhost/file.php?id=1, I get a missing image container that if I right click, does have the correct size, but obviously the image isn't showing. The record definitely exists, so I am totally stumped as to why this isnt working. FYI, the image was uploaded to the LONGBLOB column in my DB using phpmyadmin.
  8. I have the following code testing an expression: if(preg_match("(http://www)\.[^.]+\.[^.]{2,4}", "http://www.php.net")) { echo "true"; } else { echo "false"; } the result keeps coming back false. I have checked the expression in Expresso and RegexBuddy and it works in both flawlessly. Can anyone shed some light on why this is not working for me? Thank you
×
×
  • 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.