-
Posts
182 -
Joined
-
Last visited
Posts posted by slj90
-
-
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,
-
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,
-
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/1224website.com/events/page2/0101
website.comevents/page3/1105
Is this possible without having to create a separate rule for each page?
Thanks in advance! -
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,
-
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
-
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,
-
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 -
I solved it by adding a width/height to the class
-
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 -
Thank you!
-
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!
-
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');
-
I have managed to solved this, here is how.
$('#pos').on('change', function() { var topleft = "topleft"; var option = $(this).find('option:selected').val(); if(option == topleft){ alert("Top Left") } });
-
What is the difference between the two manners in which you are referencing the value??
Hint, one of these things is not like the other:
I'm not sure exactly what you mean but I have jjust changed to
alert( this.val );
Which alerts "undefined", which is why it isn't working.
When the user selects the "Top Left" option I want the function to run.
Thanks
-
So I have a select / drop down box
<select id="pos"> <option id="topleft" value="topleft">Top Left</option> <option value="topcenter">Top Center</option> <option value="topright">Top Right</option> <option value="middleleft">Middle Left</option> <option value="middlecenter">Middle Center</option> <option value="middleright">Middle Right</option> <option value="bottomleft">Bottom Left</option> <option value="bottomcenter">Bottom Center</option> <option value="bottomright">Bottom Right</option> </select>
When I use the following code it alerts the current value of the select box e.g "topleft" :
$('#pos').on('change', function() { alert( this.value ); });
But when I add an if function to only prompt the alert if the value is "topleft" it doesn't work:
$('#pos').on('change', function() { if(this.val() == "topleft"){ alert( this.value ); } });
What is wrong?
Thanks -
I want to display data from a MySQL Table but I want to skip the first row of data.
My code so far displays all the rows:
$result=mysqli_query($con,"SELECT filename FROM images WHERE item_id = '$id'"); if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { echo "<img src='../pictures/items/" . $row[filename] . "' height='200'><br><br>"; } } else { echo "You haven't added any items yet."; }
What do I need to add to skip the first row?
Thanks
-
I'm trying to display data from a MySQL table using PHP.
At the minute it is repeating the frist row 23 times, there are 23 rows in the table. What do I need to add to my code to make it display each row?
$result=mysqli_query($con,"SELECT item_item_title, item_username FROM items"); $row = mysqli_fetch_array($result); $item_item_title = $row[item_item_title]; $item_username = $row[item_username]; if (mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { echo $item_item_title . " - " . $item_username . "<br>"; } } else { echo "0 results"; }
Thanks
-
What is the best practise for websites that use a credit system? For example a website that allows a user to purcahse credits and spend them on the website. Is it as simple as increasing/decreasing their user data in the mysql table? How would more security be added to that process to avoid users editing how many credits they have etc.
Thanks,
-
I have a form which allows users to add textboxes but I am struggling figuring out what the name of the new textbox's are?
$(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append('<div><input type="text" onclick=" class="form-control" name="list[]"/><a href="#" class="remove_field">Remove</a><br></div>'); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) }); </script>
-
Hello,
It's
#Fix Rewrite Options -Multiviews # Mod Rewrite Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteRule ^page/item/(\d+)$ page/item.php?id=$1 [L,QSA] ErrorDocument 404 /error/404.php
-
RewriteRule ^page/item/(\d+)$ page/item.php?id=$1 [L,QSA]
There's no point omitting the .php here as the user won't see it and it would make Apache work that much harder to route the request.Hi,
Thanks for your reply.
When I add that liine I receive the following error "
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
"
Thanks,
-
My page structure is like this
website.com/page/item?id=1234
What do I need to add to my htaccess file to make it work when writing it like this
website.com/page/item/1234
My htaccess file currently hides the .php extenstionThanks
#Fix Rewrite Options -Multiviews # Mod Rewrite Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php ErrorDocument 404 /error/404.php
-
I have a textbox which is used for a price e.g $ 1.00
I want to code it so the X.XX format stays..
Firstly, I need to only allow numbers and '.' but how would I keep the format of 2 decimal place?
Thanks,
-
You're missing a closing " at the end of the first line. SImply viewing the code after you posted it woudl have shwon you that pretty easily
Oh yeah, thanks.
I'm now getting this error: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in /home/content/45/10084845/html/your-collection/action/logincheck.php on line 35
correct
Help changing checkbox tick colour
in CSS Help
Posted
Could someone please point me in the right direction on how to change the tick to white?
https://codepen.io/simeonj/pen/povYxox
Thanks in advance.