Jump to content

slj90

Members
  • Content Count

    181
  • Joined

  • Last visited

Community Reputation

0 Neutral

About slj90

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. I have a query that searches a single column SELECT * FROM allmovies WHERE MATCH (all_title) AGAINST ('shrek' IN NATURAL LANGUAGE MODE); However, I want to be able to search multiple columns SELECT * FROM allmovies WHERE MATCH (all_title, all_tags, all_directors) AGAINST ('speilberg' IN NATURAL LANGUAGE MODE); But that receives the error #1191 - Can't find FULLTEXT index matching the column list It works when searching each column individually, like above. What is wrong with my query? Thanks,
  2. I am using the following code to load mysql data: <div id="station_data" style="width:100%"></div> and $(document).ready(function(){ loadstation(); }); function loadstation(){ $("#station_data").load("http://website.co.uk/celebs/loadstation.php"); setTimeout(loadstation, 1000); } This works fine on my PC on multiple pages, however when testing on my iPhone and iPad it works on one page, but the exact same code doesn't work on another page. Whilst trying to get it to work I made an exact copy of the working page with a different name and it doesn't work, even though the code is exactly the same. Could it be something to do with the cache? I have tried adding a random number at the end of the URL function loadstation(){ newrnd = Math.random(); the_url = "http://website.co.uk/celebs/loadstation.php?s=" + newrnd; $("#station_data").load(the_url); setTimeout(loadstation, 1000); } I have added PHP headers header("Cache-Control: no-cache"); header("Pragma: no-cache"); And also tried turning the cache off $.ajaxSetup ({ // Disable caching of AJAX responses cache: false }); I don't understand why the same code is working on one page but not another? This problem is only on iPhone/iPad. Changing the url to just ./loadstation.php got it working
  3. $username = "user1"; $result = single_row_prepared($username); echo $username . " - " . $country . " - " . $about . " - " . $age; It says the variables are undefined. How do I echo them out? function single_row_prepared($username) { global $connect; $sql = "SELECT profile_username, profile_country, profile_about, profile_age "; $sql .= "FROM profiles "; $sql .= "WHERE profile_username = ?"; $stmt = mysqli_prepare($connect, $sql); mysqli_stmt_bind_param($stmt, 's', $username); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $username, $country, $about, $age); mysqli_stmt_fetch($stmt); mysqli_stmt_close($stmt); } [06-Dec-2017 08:19:54 UTC] PHP Notice: Undefined variable: country in /home/buysnapchats/public_html/examples/prepared_statement_single_row.php on line 13 [06-Dec-2017 08:19:54 UTC] PHP Notice: Undefined variable: about in /home/buysnapchats/public_html/examples/prepared_statement_single_row.php on line 13 [06-Dec-2017 08:19:54 UTC] PHP Notice: Undefined variable: age in /home/buysnapchats/public_html/examples/prepared_statement_single_row.php on line 13
  4. Say I had a website which uses GET to gather an ID from the URL. This ID is then used to retrieve data for page, such as the title, description and other page contents. Will Google still be able to find and display these pages in search results when the base page has no content? Do I need to do anything imparticular for Google and other search engines to be able to find these pages? If its not possible are there any solutions to this other than each page being its own unique page/file? Thanks,
  5. Hello, The user enters a 4 digit number as a date. Some examples: 0101 = 1st January 1902 = 19th Feb 2412 = 24th December Is there a way I can perform an if function to tell if the number isn't a date? For exampe if the user enters the number e.g 0001, 4112, 0199? I already make sure that it is a 4 digit number and not over 3112. Thanks,
  6. Hello, Here is the structure of my website: website.com/events/page1?date=1224 website.com/events/page2?date=0101 website.com/events/page3?date=1105 There are lots of different pages all of which I would like to use the $_Get 'date' on. I want to rewrite the URL using htaccess so that they can be loaded like this: website.com/events/page1/1224 website.com/events/page2/0101 website.comevents/page3/1105 Is this possible without having to create a separate rule for each page? Thanks in advance!
  7. function DeleteItemByID(elm) { var deleteid = elm.id; $.post('../action/deleteitem.php',{item:deleteid},function(e){ deleteidalpha = deleteid.replace(/\D/g,''); var itemdiv = "#itemdiv" + deleteidalpha $(itemdiv).hide(); }); } The above code works fine in chrome and firefox but doesn't work properly in IE. In IE it only hides itemdiv but doesn't send the data to the php file. What do I need to change for IE compatibility? Thanks,
  8. There are 2 parts to my question. Firstly, To view a users profile on my site you can type this: www.website.com/username I now want to do the same thing with the gallery page. Like this: www.website.com/gallery/username My question is, do I need to put the gallery.php page in a folder called 'gallery' or do I just need to have the gallery.php page in the htdocs main folder? My .htaccess currently reads RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1 What do I need to add to it so that gallery works too? Thanks
  9. slj90

    Resize Image

    I am using the following code to save an image if($_SERVER['REQUEST_METHOD'] == "POST") { // location to save cropped image $url = 'saved12223.jpg'; // remove the base64 part $base64 = base64_decode(preg_replace('#^data:image/[^;]+;base64,#', '', $_POST['string'])); // create image $source = imagecreatefromstring($base64); // save image imagejpeg($source, $url, 100); } But how can I resize the width and height before saving the image. I'm not sure if I should be resizing the source or the string? Please could someone point me in the right direction. Thanks,
  10. Trying to combine 2 vars and use them as an ID.. var x = "#inputList"; var y = 2; $(add_button).click(function(e){ e.preventDefault(); alert([x+y]); $([x+y]).css('display', 'inline'); y = y + 1; The alert displays #inputList2 but the line below doesn't work. Any ideas? Thanks
  11. I solved it by adding a width/height to the class
  12. On my page I have a vertical range selector. However, the button above where the range selector is don't work properly. It's almost as if the range selector is for some reason over the button and therefore making it unclickable. It's weird because about 1/4 of the button works properly but when it gets to the part that is inline with the range it doesn't function.. I tried using z-index with no luck. I am using the following to rotate it... The image is also rotated .v { transform: rotate(-90deg); } .v img { transform: rotate(90deg); } Any ideas? I have attached a picture to help explain Thanks
  13. I'm using PHP to echo out a button within a loop along with other data. ... <input id="delete' . $row[item_generated_id] . '" type="button" class="btn btn-danger" value="Delete" onclick="DeleteItemByID()"'; echo '">... I then want the function to alert the buttons ID... function DeleteItemByID() { var deleteid = $(this).attr('id'); alert(deleteid); } However, it is currently only alerting 'undefined'. What's wrong? Having the button alert it's ID is obviously not my final objective but it will help me. Thanks!
  14. Maybe this will help you http://jsfiddle.net/qrn0p43k/ This line gets the column number of the cell that was clicked... var column_num = parseInt( $(this).index() ) + 1; And this line tells the css which column to change table th:nth-child(" + column_num + "), table td:nth-child(" + column_num + ") This line changes the css $(code).addClass('pink');
×
×
  • 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.