Jump to content

SharkBait

Members
  • Posts

    845
  • Joined

  • Last visited

    Never

About SharkBait

  • Birthday 12/27/1979

Contact Methods

  • Website URL
    http://www.tyleringram.com

Profile Information

  • Gender
    Male
  • Location
    Metro Vancouver, BC

SharkBait's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Anytime something shows up with [http://afdasdfsaf] I guess anytime a URL shows up within square braces, i want to remove the square braces and the contents within them I just want the the [http://afdasdfsaf] removed. Sorta like BBCode, but it isnt
  2. So how do I go about using preg_replace() to remove a portion of a string and ignoring the rest of it? String: [http://this.is.my.site.com/stuff/funn] this is cool! so that it only returns this is cool! I can't seem to get the regex pattern right
  3. Can't seem to quite figure out what query I need to do what I want. SELECT IFNULL(id, 0) as id1 FROM photo WHERE id < 3 LIMIT 1 UNION SELECT IFNULL(id, 0) as id2 FROM photo WHERE id > 3 LIMIT 1 Essentially I want to return 2 columns, the first one being from the top query and the second one for hte bottom query. But then a union isn't what i want is it? Then i tried to do a join SELECT t1.id as id1, It2.id as id2 FROM photo as t1 JOIN photo as t2 WHERE t1.id > 2 AND t2.id < 2 But that didn't work either.. What is it I am looking for? Trying to return the the row before and after a particular entry with 1 query as opposed to 2.
  4. The php portion.. doesn't do anything with $custid your first query just pulls ALL the data You need to iterate through the array that $row will be to get it to display anything.
  5. Oh yea.. <a id="clickme" href="#">Click Me</a> Sort of thing
  6. Well it seems if within the .ajax() if I set async: false that worked, but then I had a weird reloading issue but putting event.preventDefault(); before the $.ajax seemed to fix that issue. Is this just some weird behaviour I am seeing or typical operating procedure?
  7. Ok this is bugging me, I'm trying to do a simple ajax request via a click of a link and even though Success triggers, the response is empty. <?php $pid = '123456789'; ?> <script> $(document).ready(function() { $('#clickme').click(function() { alert('You have clicked me'); $.ajax({ url: 'getphoto.php', type: 'GET', data: {pid: '<?php echo $pid;?>'}, dataType: 'html', success: function(data) { alert('Data Sent: '+ data); } }); }); }); </script> Then the php file: <?php if(isset($_GET['pid])) { $pid = $_GET['pid']; } echo 'You wanted to show a PID of: '. $pid; ?> Why do I get does this successed, but not return anything for `data`
  8. What I decided to do was rename the directories to have a character similar to them blahblah-p and then when someone goes to blah.com/pix/blahblah it will pull the files from blahblah-p directory if it exists. *shrug*
  9. When you don't do something for a long time.. it slips from you! Or at least it does for me. RewriteRule ^([A-za-z]+)$ index.php?dir=$1 [L] What I want to accomplish is: blah.com/pix/Tree or blah.com/pix/Tugboat the index.php file within /pix will use the Tugboat or Tree as variables (via GET). Though.. the tricky part is that Tree an Tugboat will actually be directories with photos in them. The idea was to have /pix handle URL requests to display the photos within the specified directories. I don't want people to access the directories. Can it be done? Can we trick Apache into thinking there are no directories, when there are? Just creating a really quick and easy photo thing for myself. All i have to do is drop the photos into a directory and then blah.com/pix/racecar will allow me to display the photos within that directory via the index.php file that will style the single page.
  10. For some reason I cannot think today. <?php class { function meh() { $blah = $this->profile(); echo $blah->weirdname; } function profile() { // this is where I'm stuck.. // how do I properly set weirdname? } } ?> It's been a while since I've played with classes (been doing other things) so how do I set up the function profile() to return a value for weirdname.
  11. Am I right to assume that when you use wildcards (%) in a SELECT WHERE clause, that it will only match based on order of given terms? IE: SELECT * FROM name LIKE ('%this%that%') Will only match: 'something like this is like that', or ' this thing is that thing' etc? Where as SELECT * FROM name LIKE ('%that%this%') will not match any of the above, since the order of terms are reversed? I would assume that FULLTEXT search would be the ideal thing to use, right? Since the terms being looked up can be in no particular order?
  12. Linking to tables within the same database usually is done with fields that are similar. Table1 has a field called id Table2 has a field called table1_id Then you would link id from the first table to the value of the table1_id field. Make sense? The two tables need a relationship to be able to relate them.
  13. Typically when dealing with checkboxes, if you want 1 checkbox to allow all checkboxes checked it would be done with javascript. If you want PHP to check off all checkboxes within a loop you would add checked="checked" to the html code of the checkbox themselves.
×
×
  • 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.