-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
Always best to use a test database for development. Take daily backups.
-
Client wanted brand awareness. Traffic. No PPC involved.
-
ffmpeg does have a php library (ffmpeg-php) http://ffmpeg-php.sourceforge.net/ You need to have ffmpeg installed on your server to use it.
-
Unsure what you mean here. We make apps for Facebook. Pay Per Click isn't a part of it. There is no money involved when a user clicks on your app.
-
Use ORDER BY in your query SELECT * FROM tablename WHERE id IN(101,110,102) ORDER BY id ASC
-
http://www.webdevelopersnotes.com/tutorials/sql/tutorial_mysql_in_and_between.php3
-
Doesn't really matter about the number of rows. More of a concern is what the table is being used for and the number of queries that run on it at a given time. also could you check your script I cant get it to randomise a table and print it, im also using the table you showed in your example The script is not a complete working example. The code prior to the database query is valid and produces an array of random numbers between 1 and 100 however you will have to add the parts to connect to your database, run the query and loop over the results to print them. You should be able to do this yourself.
-
I'm not the greatest when it comes to more complex rewrite rules so here goes. My directory structure is similar to: (/docs is the document root) docs/index.php docs/file1.php docs/sitefiles/index.php docs/sitefiles/file1.php docs/sitefiles/file2.php And so on. OK, here's the issue. I am trying to backref a url parameter that is sent to the index.php file within the sitefiles subdir for example http://mydomain.com/sitefiles/foobar.com http://mydomain.com/sitefiles/foobar.co.uk The domain at the end is the param I need to capure. The original url is something like: http://mydomain.com/sitefiles/index.php?url=foobar.co.uk So, my .htaccess sits in the sitefiles directory and looks like RewriteEngine On RewriteRule ^([a-z-]+\.[a-z]{2,}\.?[a-z]{0,})$ index.php?url=$1 [L] But when I try this the value contained in $_GET['url'] is index.php. Wierd.
-
It means give me any record where the primary key value is one of the supplied values i.e If this is your table, lets call it 'users': id | name ======= 1 Joe 2 Neil 3 Adam Then the following would give me the first and last record SELECT name FROM users WHERE id IN(1,3)
-
Simple answer, you dont need to. You cart contents are already contained within a session. Simply write a simple function that gives you the cart total that you can call on any page. Loop through the cart items price and times by the quantity. There is your total. You have already posted part of the code. Sessions persist throught a script (as long as you have called session_start()) until they are destroyed i.e You will destroy the shopping cart session after the user has paid for their items. You would never send prices, totals, etc through the url. This can be easily manipulated and users could end up paying nothing for the items in their cart.
-
This quite clearly explains why using RAND() for large result sets is a bad idea. http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/ Using your script to randomise the data is much more efficient. For instance, if you have 100 records in your table and the primary keys are ordered correctly 1 - 100 then I can use php to give me x numbers between 1 and 100. So if I wanted 5 random records from my table: <?php $randoms = array(); $required = 5; // get me 5 numbers between 1 - 100 for($x = 0; $x < $required; $x++) { // generate number $number = rand(1,100); // have we already used this number? if(!in_array($number,$randoms)) { $randoms[] = $number; } // yes, try again else { $x--; } } // run query $result = mysql_query("SELECT * FROM tablename WHERE primarykey IN(".implode(",",$randoms).")"); ?>
-
Is that a serious question? The simple answer is one that is not broken.
-
I'll help you out with your php programming for some England tickets if you dont want them
-
I would like to goto college for programming?
JonnoTheDev replied to Sandwhich's topic in Miscellaneous
A lot of the posts here are referring to University courses like Computer Science, however in the original post it states College. Courses at college differ from courses at a University as you are working to degree level in uni. I suppose the 2 do overlap in some cases but the graduates who I have taken on who did a degree in Computer Science did not cover the same subjects as when I went to college. I got a diploma from college in Software Engineering (long time ago). This was purely programming and application design, no networking or graphics, etc, however there were additional courses available to do that stuff with photoshop & 3d studio max, etc. Like Daniel stated you should just ask the college, speak to a representative from the IT department or have a look through the prospectus at what they offer. -
I would like to goto college for programming?
JonnoTheDev replied to Sandwhich's topic in Miscellaneous
Plenty, have a browse through job search websites. Games developer Web developer / designer Network Engineer PC Technical Support Systems Analyst Software Engineer -
Hello. Are you looking forward to the World Cup?
-
Can any one explain why xml is used instead of a database?
JonnoTheDev replied to tallberg's topic in Miscellaneous
There are many methods for storing data i.e text files, databases, spreadsheets, xml, full text indexes, etc The method used for storing data depends on the type of application and the functionality required. If you look into XML, its number one feature is that it is platform independent i.e. If you have many applications that are written on many different platforms or even if you are making your data open to the outside world the best way to share your data is via XML. You will see many websites that share data such as twitter, facebook, etc. When you make a request to one of these systems the data is usually returned in XML. Your application can then parse the XML and display the information on screen. I think your assumption that XML is used instead of a database is incorrect. The system may still run from a relational database, however it may have an API available where you can query the system and the results are returned in XML format. -
<?php mysql_query("UPDATE table SET field='1' WHERE sid='".mysql_real_escape_string($_SESSION['RID'])."'"); ?>
-
Yeah, thing is though I need the public ips to be location based so I can't just buy a load of servers in the US. UK servers are not so cheap. I will have to hunt around.
-
Squid, or any proxy server software really. However the servers im looking at are cheap as chips so they aren't going to be letting you install software. I maybe fighting a losing battle here.
-
LOL. What a pair of retards. The one on the left is definately the bitch. Its like watching Bill & Ted.
-
Then this is not what I am looking for. I need to have proxy servers through public IP:port just as: http://www.samair.ru/proxy/type-01.htm not having to setup each local machine. I will have to find out how to setup a cheap server as a proxy so I can just use its ip in any proxified software. Proxy server addresses on lists as above are unreliable, they get battered and are often offline. Similar issues with using the TOR network. Private proxy addresses are expensive with the numbers we use.
-
If you want to include a file from a directory outside of your document root i.e public_html/index.php includes/file.php public_ftp/ etc/ Then you have 2 options 1. Use the full path to the directory <?php // index.php include('/home/myfolder/www/includes/file.php'); ?> 2. Set the include path <?php // index.php set_include_path(get_include_path().PATH_SEPARATOR.'/home/myfolder/www/includes/'); include('file.php'); ?> http://uk2.php.net/set_include_path
-
The include should have a path from the originating file location. i.e If my directory/file structure was: /docs/index.php /docs/includes/functions/common.php Within index.php if I wanted to include the common.php functions file I would simply use: <?php // index.php include('includes/functions/common.php'); ?> In your case public_html/ is the document root, so your index.php file sits in that directory.