- Upvotes Received
- 9
- Posts with Upvotes
- 8
- Upvoting Members
- 9
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
21 Posted Topics
I use a webservice to pull some data from it everyday & update it on my MySQL database. I'll make around 600 calls to this service. The webservice response is very slow (takes around 30 minutes to complete 600 transactions) & during this time, the MySQL is also giving slow … | |
Hello, I've been asked to create a tool using 3rd party API. The API requires to send the user details in encrypted format. The problem here, they didn't mention what kind of encryption we should do. They just provided a two C++ functions to encrypt the data. I'm a PHP … | |
Hello, I'm a python beginner & I'm learning it on my own. So, I've few (dumb) questions about it. - Where should I host a python project on linux? I'm sure there'd be multiple choices. So, Where would you host it & on what circumstances? - I understand that `virtualenv` … | |
Hi, I don't know if there is some name for this but what I want to create a script in php which runs in the background and capable of sending and receiving messages. This is what I want to do exactly: 1. Listen to a URL http://site1.com through xmpp protocol. … | |
Re: You could use `preg_match()`. I'm not so good with regular expressions but I hope this'll solve your problem. $str = "i want to buy a new car"; preg_match("/\S*\s\S*\s\S*/", $str, $result); echo $result[0]; //prints: I want to ![]() | |
Hi, I'm creating a game where users play daily & earn points. I wanted to record the scores of each user each day for a month. At first, I thought to create 31 columns within the table & store the score in the appropriate date field. But, I think it … | |
Re: No, Its not possible with PHP. But, you can do it using javascript's [window.find()](https://developer.mozilla.org/en-US/docs/Web/API/window.find) or with [jQuery Hotkeys](https://github.com/jeresig/jquery.hotkeys). | |
Re: Both are same except that `require` will produce fatal error on failure while `include` gives a warning. ![]() | |
Re: Did you try [Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/). It is very simple. include 'simple_html_dom.php'; $html = file_get_html('http://www.daniweb.com/'); foreach($html->find('h1') as $element) echo $element->plaintext.'<br>'; //find & echo all the h1 tags See the link for documentation. It is easy to understand too. ![]() | |
Re: Hi, It is pretty simple to migrate from *mysql_* to *mysqli_* . You just need to replace all the `mysql_` expressions with similar `mysqli_` expressions. Just refer [PHP mysqli documentation](http://php.net/manual/en/intro.mysqli.php) to find the similar expression in `mysqli_` that matches your `mysql_` statement and replace it. That's it! PS: If you … ![]() | |
Re: Hi, I've found a script on stackoverflow which might help you. [http://stackoverflow.com/a/6583079](http://stackoverflow.com/a/6583079) ![]() | |
Re: If you want something like you showed in the example. `str_pad()` will help you. //Assuming $id is the AUTO_INCREMENT id from the database $unique_number = str_pad($id, 5, "0", STR_PAD_LEFT); | |
Re: Assuming you use `mysqli_` extension, here is a sample code that might help you. <?php echo "<select>"; $result = mysqli_query("SELECT * FROM table_name"); while($row=mysqli_fetch_array($result)){ echo "<option value='".$arr['option_number']."'>"; echo $row['option_name']; echo "</option>"; } echo "</select>"; ?> ![]() | |
Re: I'm not sure but I think this is what you are looking for: [fetch_array()](http://php.net/manual/en/mysqli-result.fetch-array.php). Use something like this: $row = $stmt->fetch_array(MYSQLI_ASSOC); echo $row['lastname']; Click the link for explanation. Hope that helps. ![]() | |
Hi, I'm trying test some WSDL url and got the same error as mentioned [here](http://stackoverflow.com/questions/14384515/). As I've no prior knowledge with WSDL, after doing some search, I found that this is because the location url in the `soap:address` tag is not reachable. Am I correct? Is this a possibilty to … | |
Re: Hi, On line 10, `"` should be before `)`. Also,why are you using `['$id']`? Just `'$id'` would be sufficient. So, finally, change line 10 as shown below: mysqli_query($con,"UPDATE table1 SET score=score+1 WHERE id='$id'"); | |
Hi, I'm trying to check the format of the string with `preg_match()`. It has to accept only the `(zero or more of ,.* )(exactly 9 or 5 digit number)(1 or more of ,.* )(postive integer <= 4digits)(zero or more of ,.* )` format of strings. Here, is what I tried: … ![]() | |
Re: One more final question. Why did you suggest me to use, `echo sprintf()` instead of `printf()` . What difference does it make? ![]() | |
Re: You can do it easily with [array_chunk()](http://php.net/manual/en/function.array-chunk.php). $urlArr = array_chunk($urlArr,2); print_r($urlArr); Now, you'll get your desired output. | |
Re: These articles on davidwalsh.name might help you. For getting website data [click here](http://davidwalsh.name/curl-download) and for HTTP headers [here](http://davidwalsh.name/curl-headers) | |
Re: Assuming, you want search your database with multiple values (from the title) & want to correct the sql query you have written (in the last line). Here is the solution. SELECT * FROM tb_job WHERE (job_keyskills='PHP' OR job_keyskills='PHP Developer') AND (job_location='Delhi' OR job_location='NOIDA'); Hope that helps. |
The End.