Cyto
-
Posts
69 -
Joined
-
Last visited
Posts posted by Cyto
-
-
Hi,
Is it possible to order by the first letter of name?
Data is coming from a post value.
$qorder = substr($q,0,1); SELECT * FROM data WHERE name LIKE '%$q%' OR info LIKE '%$q%' Want something like this: ORDER BY name='$qorder%', but doesnt work
Thx,
-
Hi, wye does $link return a empty row in mysql?
$link = $m[1]; $ssql = "INSERT INTO site (id, link) VALUES ('', '$link');"; mysql_query($ssql);
Thx,
-
k thx
-
/*** a new dom object ***/ $dom = new domDocument; /*** load the html into the object ***/ @$dom->loadHTML($file); /*** discard white space ***/ $dom->preserveWhiteSpace = false; /*** the table by its tag name ***/ $tables = $dom->getElementsByTagName('table'); /*** get all rows from the table ***/ $rows = $tables->item(0)->getElementsByTagName('tr'); /*** loop over the table rows ***/ foreach ($rows as $row) { /*** get each column by tag name ***/ $cols = $row->getElementsByTagName('a'); /*** echo the values ***/ echo $cols->item(0)->nodeValue.'<br />'; }
Hi, Is there a way to start to echo from 43?
thx.
-
Hi,
Can someone check wye this gives a empty array:
$url = "http://www.someurl.com"; $file = file_get_contents($url); $preg = '<a href='."'(.*)'".'><span class=window2 style="text-transform: capitalize">(.*)<\/span><br \/> [(.*)]<\/a>'; preg_match_all('/'.$preg.'/i', $file, $m); //name print_r($m);
Output:
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) )
I am trying to find a name link in a,span from another site, but gives me a empty array. Can someone help?
thanks, Cyto
-
Anyone?
-
Hi,
I have a fixed position div at top(green block) and I'm using this slider(http://slidesjs.com/). When I scroll down the image and the h1 text overlays the fixed top div (green block) and I want the slider to be at the bottom of the green block.
Can someone help me?
You can see the layout here: http://serdarg.nl/2011/hosting/
Cheers
-
I added a witdh to the float element. It worked. Thx.
-
Hi,
My site(http://www.gameson.nl/) on browser ie9. I have floating problem(i think), but don't know how to fix it. Can someone help?
It displays correct on firefox and chrome.
Cheers
-
Maybe:
UPDATE `table` SET `string` = REPLACE(`string`, "'", '')
If you need some kind of filtering add a WHERE clause.
Thx, but nvm. I figured it out myself. I added mysql_real_escape_string() in the where clause. It added a slash to the quoted strings. Worked.
Thank you too, teynon.
-
Please post the rest of the code. I don't know what you are trying to do right now. Please post code, don't just try to restate what you just said.
I'm trying to delete a row with a quote in a string and add a row with a quote in a string. The adding works with stripslashes, but the deleting part... I'm stuck there.
-
Your trying to delete a row from your database based on the name value? We would need to see how it is stored in the database. Is it stored as Cyto's or Cyto/'s?
It's stored as Cyto and I add 's, it becomes Cyto's. Ok it works, but when I want to delete a row with 's in a string(Cyto's), it returns as Cyto's back instead of Cyto.
P.S Cyto as string is a example, there are other words.
-
Hi,
I'm trying to delete a string that's single quoted. From: Cyto's to Cyto, but doesn't work. It works when I add 's to the string with stripslashes, but I can't seem to delete a quote from a string.
Does someone know how?
My $_post code:
$name=mysql_real_escape_string(stripslashes($_POST["ename"]));
Cheers
-
Thx WebStyles, AyKay47, it worked. If someone has the same problem, dont forget to add a slash: \'s. It wil read the result with a quote from the database.
-
then you'll want..
$getname = $_GET["name"]; $name = str_replace(" "."'",$getname);
will replace the space in the string with an apostrophe
I know, but doesnt it replace the space too, it will output Papa's'Home instead of Papa's Home?
-
okay so you'll use something like
$getname = $_GET["name"]; $cleanname = array("-","/"); $name = str_replace($cleanname,"'",$getname);
$name should output papa's
This works if the result were all with quotes, but it isn't. Then the names without a quote wouldn't work. I'm already adding the names with stripslashes. The name is already Papa's Home in the database. But I when i go to this link http://www.link.com/papa-s-home/, it querys papa s home. I need to add a quote somehow to strings like papa s, mama s etc. To get a result from the database.
-
escape the quotes.
$string = "Papa\'s Home";
in this situation, you actually wouldn't have to, because I used double quotes on the outside, and a single quote inside, but if you're planning on putting this into a database you'll definitely need to escape your strings properly. look up mysql_real_escape_string, addslashes and stuff like that.
good luck
Another problem that I'm having:
I want to get ($_GET) the name like this: Papa's, so i can get the result from the database..
The url: http://www.link.com/papa-s-home/
but i need to have papa's home with a quote to get a match from the database. So i need to add a quote at the empty spot Papa s, but how can i do this. My part of the code:
$getname = $_GET["name"]; $cleanname = array("-","/"); $name=mysql_real_escape_string(str_replace($cleanname," ",$getname));
I hope you'll understand it, sorry for my english
-
Hi,
I want to add a quote to strings if needed. Example: Papa s Home, must be Papa's Home.
Is this possible?
Cheers
-
I see, thx worked.
-
someone?
-
Hey,
I have this code:
<script type="text/javascript"> $(document).ready(function(){ $('.rij2_content_fav').hide(); $('.mijngames').click(function() { $('.rij2_content_fav').slideToggle('slow', function() { $('.rij2_content_fav').animate({left: "-=232px", top: "+=50px"}); }); }); }); </script>
The code works, does his job, but it toggles only one time. I need to refresh page to toggle again. How can i fix this, so that it toggles when i click several times?
Cheers.
-
Hey,
I have a while that shows the rows(duh). What i want to do is: show 3 rows then echo float left or clear both. So basically 3 at a time, but it shows all the rows in a nice order. Can someone do this?
Cheers.
-
Hm, ye i see. Thx.
-
Hey,
Well when they view my website from home. We get the same (public)ip. Is there a way to tell that these people are not the same person, not using the same ip, because i am saving data from the ip(visitors). The others will get the same date too, because of the same ip. Or is there any other way to get a unique id(number) from visitors?
Hope you understand.
Cheers.
Mysql order by first letter of name
in MySQL Help
Posted
I mean order by the value from post, so when the value is Santa. I want to order by S of Santa.