Jump to content

biggieuk

Members
  • Posts

    159
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

biggieuk's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi all, I am building a random prize assigner function based on weighted percentages. I am able to assign a basic true/false weighting but am struggling to form a way of selecting an array based prize based on the win rate. Heres my current code: function selectPrize() { $prizes = array( 0 => array( 'name' => 'Top Prize', 'rate' => 50 ), 1 => array( 'name' => 'Middle Prize', 'rate' => 30 ), 2 => array( 'name' => 'Bottom Prize', 'rate' => 20 ), ); // oops } selectPrize(); Could somebody please give me pointers on how i could approach this? Thanks.
  2. I have setup a jsfiddle of what i'm trying to do: http://jsfiddle.net/MgcDU/3936/ The image of the cat is my background image which resizes as the browser resizes. The ball image is absolutely positioned over the cat. How can I get the ball image to resize and stay in the same position as it is my default? Thanks for help with this
  3. Hi, I am building an RSS Aggregator plugin for my Wordpress Installation. One of the feeds I am using is: https://news.google.co.uk/news/feeds?pz=1&cf=all&ned=uk&hl=en&cf=all&as_qdr=w&output=rss&q As you can see this feeds content is a table of data including news headline, excerpt and a tiny thumbnail image. How is it possible for me to extract the actual full article text and the large Image from the <link> tag of the RSS item or does it look like I have the wrong news feed? Thanks for advice with this.
  4. Hi all, I am using a MAC to tunnel to the servers at my work so that I can work from home. I am using http://coccinellida.sourceforge.net/ to firstly tunnel into the work server then create a local alias at localhost port 2000. I am then able to use Filezilla to SFTP to localhost:2000 using my username and password. I want to be able to create a local drive so that I can work with the files in my code IDE. I tried ExpanDrive and Transmit, both won't connect to the same localhost connection that Filezilla will connect to. Expandrive gives no errors but Transmit says permission denied. Anybody have an idea how to sort this problem out so that i can mount the sftp as a local drive? Thank you for your help
  5. thanks for your reply. Yeh a table type column would be needed too. So a separate INSERT for each row is the best way to do this? Just seems a bit of an overhead but can't think of another way. thanks
  6. Hi all, Having a little trouble designing my database for a project. The web app consists of a number of 'pages', each page with a form and some fields on. The fields on each form need to be editable and stored in a database. So basically it is a number of forms with dynamic fields. My current table structure is as follows: Questions Table id field_name title description orderno 1 company_name Company Name What is your company name 1 2 telephone Telephone Number What is your telephone number 2 Then for each time a user starts a questionnaire a row is created/updated in the 'assessments' table: Assessments Table id user_id question_id answer 1 32423 1 My Company 2 32423 2 01144556677 For a static form I usually would do an INSERT statement and insert the value corresponding to the column name, however using the approach above I would need to do an INSERT for each separate question on each form. Does this seem like the best approach for storing data on a per user basis for a dynamic table? thanks for your guidance on this.
  7. Hi all, Bit of an odd question. I am using Maxmind GeoIP (http://www.maxmind.com/app/ip-location) to locate the approx location of users. The api returns an object containing longitude and latitude. I now need to use these longitude/latitude values to determine if the user is: England Scotland Wales Republic Ireland Northern Ireland Rest of World An option is to gather the lon/lat of these areas and test if the user is within this range. What would be the best way to go about this? Anyone done anything similar? Thanks for help with this!
  8. Thanks for the reply. I am aware of Google but didn't find anything that did the same job of SecureCRT but without the ancient command line interface. I guess it's just something I will need to get used to until I find the right powerful GUI.
  9. Hi all, Not entirely sure if this is the correct forum for this question. I am relatively new to git and SSH. After starting a new job I quickly realised that I need to learn this. I am using SecureCRT to connect to the webserver and have been using commands such as: git add ... git commit ... :qw ./publish I understand the basic principles of git and committing changes to the server but I can't help but feel that there should be a simpler GUI to do this for Windows7. Is there a program for windows that would make this process easier to understand? thank you.
  10. I am developing a mobile specific version of a web site. I am using the following tags in the header which work for the iPhone: <meta name="viewport" content="width=device-width, user-scalable=no" /> However on an Android phone the initial view is zoomed in too close. Is there something i'm missing that can fix this problem? Thanks
  11. Hi all, I am usually able to make my horizontal menus center correctly in IE7 but can't seem to make it happen with this. http://jsfiddle.net/9bkgd/1/ If you view in most other browsers the items will horizontally be centered but not in IE7? Please help!
  12. Thanks Keith, I managed to fit your example to my project
  13. thanks for your reply, I think my explanation could have been better. Basically I am currently returning rows like so: code colour size quantity admin 123 2 34 1 0 143 6 23 3 0 145 8 37 1 0 The query is grouping the rows by code, size and colour then counting the quantity column. I need the query to group the results like above but only if the admin column is 0. If admin is 1 then just output the row without grouping like so: code colour size quantity admin 123 2 34 1 0 143 6 23 1 1 143 6 23 1 1 143 6 23 1 1 145 8 37 1 0 Is that any clearer?
  14. Hi all, I have a SQL statement which selects all records from a table, groups them by product_code, product_colour & product_size. I have added a new column 'admin'. I need to alter the query to return the items like before but only group the items that have 'admin' set to 0. Is this possible in one single query? SELECT *, SUM(quantity) as item_quantity FROM orders_items WHERE orders_id="1" GROUP BY code, sizes_id, sizes_id_2, colours_id ORDER BY id ASC Thanks for help with this
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.