naeembhatti
Members-
Posts
18 -
Joined
-
Last visited
Never
Everything posted by naeembhatti
-
how to create stored procedure in mysql and how to call it on php?
naeembhatti replied to naeembhatti's topic in MySQL Help
no, i used mysqli for it -
how to create stored procedure in mysql and how to call it on php?
naeembhatti replied to naeembhatti's topic in MySQL Help
no there are SP in mysql and they are perfect i used them in my application, i advise you to use them in future for best performance and your growth -
hi friends h r u? i use simple stored procedure e.g in mysql============================= CREATE PROCEDURE `test`.`users` (OUT returnval int) BEGIN set returnval = 100; END // how to get its value in php===================i am currently using this $mysqli = new mysqli("localhost", "root", "bhatti", "test"); if (mysqli_connect_errno()) { printf("Connection failed: %s\n", mysqli_connect_error()); exit(); } $SQL = "CALL users(@retval)"; if (!$mysqli->real_query($SQL)) { printf("Invalid query: %s\nWhole query: %s\n", $mysqli->error, $SQL); exit(); } if ($result = $mysqli->store_result()) { while ($myrow = $result->fetch_array(MYSQLI_ASSOC)) { print_r($myrow); } $result->close(); } $mysqli->close(); ======================================= but when i wrote in phpmyadmin like CALL users(@retval); SELECT @retval; it returns me value but how to get it in php?
-
try to use this [code]fopen("/home/rasmus/file.gif", "wb");[/code]
-
[code] <input type=checkbox name=list[] value=1> <input type=checkbox name=list[] value=6> <input type=checkbox name=list[] value=4> <input type=checkbox name=list[] value=13> <input type=checkbox name=list[] value=19> make it an array. <? just print the array. for($i=0; $i< count($_REQUEST['list']); $i++) { echo $_REQUEST['list'][$i]; } ?> [/code]
-
how to sort multi array to make a single array?
naeembhatti replied to naeembhatti's topic in PHP Coding Help
wawooo thank u very much it works very fine but i was not 100% sure that what is happening lol. now i got it thanks u once agin. -
how to sort multi array to make a single array?
naeembhatti replied to naeembhatti's topic in PHP Coding Help
will u plz explain me a very brief description of ur solution thanx artacus. -
how to sort multi array to make a single array?
naeembhatti replied to naeembhatti's topic in PHP Coding Help
thax very much artacus. it is looking easy now but it was looking very difficult to me. -
hi guys how are u i am in trouble plz help me, my prob is. i have 3 arrays A = Array ( [0] => 2 [1] => 1 [2] => 3 [3] => 4 [4] => 5 [5] => 7 [6] => 6 ) B= Array ( [0] => http://localhost/script/images/children/img1.jpg [1] => http://localhost/script/images/children/img3.jpg [2] => http://localhost/script/images/children/img2.jpg [3] => http://localhost/script/images/children/img4.jpg [4] => http://localhost/script/images/children/img10.jpg [5] => http://localhost/script/images/children/img10.jpg [6] => http://localhost/script/images/children/img10.jpg ) C= Array ( [0] => http://localhost/script/01 [1] => http://localhost/script/03 [2] => http://localhost/script/! [3] => http://localhost/script/04 [4] => http://localhost/script/10 [5] => http://localhost/script/a [6] => http://localhost/script/description ) ====================== array(A)-> defines the sort order array(B)-> should be as sort order of array(A) array(C)-> should be as sort order of array(A) actually array(A) is a main array which contains the sort order like in [0]=>2 , [1]=>1 i want so make a single array having sort order of array(A) like if array(A) have its 1st element to 2 then i want to pick 2nd element from array(B) and from array(C) i want to make a double dimension array
-
search for text in html body using javascript?
naeembhatti replied to naeembhatti's topic in Javascript Help
okey but if i want to get only text in a body which contains bold tag e.g <b>Hello World</b> Or <b class='something'>Hello World</b> Or <b><span class='somthing'>Hello World</span></b> anyother text contains bold or having strong tag i want to search for only this please tell me how and also please help me where i can found more detail about RegExp(); thanks a lot. -
search for text in html body using javascript?
naeembhatti replied to naeembhatti's topic in Javascript Help
please can give me a example? -
how can i search for html body for text in <p>hi h r u?</p> tags or in <b>hello world</b> e.g <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> aaaaa<p>hi h r u?</p>bbbbbbbbbbbbbb<b>hello world</b>ccccccc </body> </html> i need only "hello world" or "hi h r u?" please help me
-
getting error while connection fsocket to this site.
naeembhatti replied to naeembhatti's topic in PHP Coding Help
yes you are right this is exact my problem is actually i need to fetch all the images from that link (bookmarklet feature as kaboodle.com) and a title from that link without posting any thing, possible? -
getting error while connection fsocket to this site.
naeembhatti replied to naeembhatti's topic in PHP Coding Help
actually i did not want that this site redirect to other page i need to get the contents of current page having same variables i use this as u recommend me. <?php // create a new CURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.canadiantire.ca/assortments/product_detail.jsp?FOLDER%3C%3Efolder_id=1408474396669883&ASSORTMENT%3C%3East_id=1408474396670271&bmUID=1159850265943&PRODUCT%3C%3Eprd_id=845524441896143&assortment=primary&fromSearch=true"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // grab URL and pass it to the browser echo curl_exec($ch); // close CURL resource, and free up system resources curl_close($ch); ?> thank u for help. -
getting error while connection fsocket to this site.
naeembhatti replied to naeembhatti's topic in PHP Coding Help
please have a look here http://www.dealarmy.com/curl/ i wrote a code provided by u and it is returning me a same error? i want to get all the images from this site like bookmarklet? -
getting error while connection fsocket to this site.
naeembhatti replied to naeembhatti's topic in PHP Coding Help
okey right, thank for the solution. please can u tell me a little bit more about curl how can i use it or how can i access a socket of any site and is it installed on web server or i have to do? where from download it? -
this is my example code. [code]<?php $fp = fsockopen("www.canadiantire.ca", 200, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: http://www.canadiantire.ca/assortments/product_detail.jsp?FOLDER%3C%3Efolder_id=1408474396669883&ASSORTMENT%3C%3East_id=1408474396670271&bmUID=1159779949708&PRODUCT%3C%3Eprd_id=845524441896143&assortment=primary&fromSearch=true \r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); } ?>[/code] this function works for all sites but when ever i use this function for canadiantire.ca it generates this error " HTTP/1.0 302 Found Server: CacheFlow-Proxy/1.0 Location:http://www.http.com/ Connection: close Content-Length: 90 Redirect " i don't know what could be its solution please help me out. [nobbc][edited by a moderator kenrbnsn, to surround the code with [code][/code] tags][/nobbc]