Jump to content

gibbonuk

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gibbonuk's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, im a little confused on which way im meant to be doing this. I have a URL that my php builds with parameters depending on user selections. So we may end up with: www.mysite.co.uk/mypage.php?p1=10&p2=20&p3=40 And i have a simple mod rewrite to show that more SEO friendly. So a user could goto www.mysite.co.uk/mypage-p1-10-p2-20-p3-40.html and it would work, BUT when the user goes to the above .html address it works but shows in the address bar as: www.mysite.co.uk/mypage.php?p1=10&p2=20&p3=40 I also thought it would be good to build my links withing PHP as the SEO friendly ones but again, when the link is clicked the user sees the old one? So.. which way am i meant to be doing this? What i would like is to completly hide the actualy URL and have it so if the user goes via the SEO friendly one it works and SHOWS the SEO freindly one, this way i can use them links in my pages aswell. Thanks Andy
  2. Hi, ive just added friendly static URLs via .htaccess to my site and was wondering if i should now use them as my internal links? For example, i can now goto www.mysite.com/product-laptops-dell.htm instead of www.mysite.com/products.php?cat=laptops&brand=dell which is fine as i can use them for google's webmaster tools for adding my sitemap. BUT, when i build my links in php should i build them as "www.mysite.com/products?cat=laptops&brand=dell" or as "www.mysite.com/product-laptops-dell.htm "? and does it really matter? Thanks Andy
  3. Thanks! reading back..I cant belive the you understand my question nevermind the fast response. Works a treat. Andy
  4. Hi i have a query that changes depending on the users selection for "narrowing" down the results. So i achived this by for each selected wanted i added a "and" opertator to the query. but for one field i want it to be And & or. But what i found is happening is its checking the or with all the ands, not just the field i want it to do. How can have multiple ands but for just one of them i want it to have a or. This all sounded very confusing to write, hope you understand. Thanks Andy
  5. Ok well what im trying to do is store the value as it is and then the average of that last X values. So for this, i figured in the loop i need to get the current value (simple) and then some how the last X amount of values to calculate the average. So i end up with two arrays: array1 is filled with the actual numbers array2 is the same size as array1 but the values are the averages of the last X values. does that make any more sense? Yes, i guess calulating the averages from the arrays i have filled is one way, is it the best? can this not be done on the fly by getting the current row + the previous row(s)? Thanks Andy
  6. Hi PFMaBiSmAdm, i really would post some data but i think it would be meaningless, as theres a few variables and loops within that i cant imagine make any sense to any but me. lol But I have a single database with 6 columns and many rows, all filled with small numbers (from 1 - 10). At the moment im just fetching a range of data back so say 10 rows and then putting them into an array in the structure above. But now i want to add another array that stores the current number + the last previous number for each column. Thanks Andy
  7. Hi, im trying to get my head around this problem but unfortunatly its startig to hurt so come here for a bit of help. Im using this structure to get my results from my DB: <?php $query = "SELECT * FROM numbers"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $test[] = $row['number']; } ?> But what i want to do but dont know how is something like this: <?php $query = "SELECT * FROM numbers"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $test[] = $row['number']; $test2[] = $row['number']+THE NUMBER FROM THE PREVEIOUS ROW??; } ?> How do i go about this? Thanks Andy
  8. Hi, im trying to learn about socket in PHP but unfortunatly not getting anywhere fast. The main issue is, the reason i want to learn about them is for use on a project where i will be connecting to a server, not actually being one. So although i am interested in the server part, its not essential. But to test my php socket code, i need something to connect to for debugging? So i have tried to create (from tutorials) a php server but not had any luck at all, can anyone advise me on where to start here? I basically want a way to send a command from a php file over TCP/IP, but for now just want it to bounce back or get a response, is there any test servers out there or do i have to create one? I have my own windows web server running here next to me for all my testing. Thanks Andy
  9. Hi sorry to consuse you, what is meant by 70 x 2 bytes, is the insert will insert a row that has 70 columns, each with 2 bytes of data. So every minute, the delphi software will add a single row, with 70 columns and there maybe upto 100 delphi applications doing this, but each delphi application is inserting its data into a table of thier own. The minute requirement is just because thats when the delphi application gets hold of the data. Is this classed as excessive or not? Thanks Andy
  10. Hi all, im just wondering in which direction to carry on along with the current project im assigned to. Bascially, i provide a website for user to log into and look at data (2 byte values) inside a DB, there is about 70 per row. Not huge triffic at all as its not a public website. The worry i have though is getting the data "into" the DB, it will be entered from a delphi application NOT local on the server, and ideally i would like the data to be entered every minute. So inserting one row so 70 x 2 byte values every minute. But i may have 100 of these doing that? Is that "alot" or should it be ok? No server specific hardware at the moment as this is all in development, curren tly using a standard PC as a webserver. Thanks Andy
  11. Yes thats correct at the moment. And yes i guess i am, not that the data is to any relevence to anyone and im sure would be dissapointed, its good to still include some security. How do i go about configuring it to allow only certain connections? As it stands all i would need is my one central server and local connections to be allowed. Is there a guide, the server setup is somthing ive learnt as ive gone on. Thanks Andy
  12. Ok, this is more about the method as apposed to the code but obviously related. Im currently doing it one way not sure if its the best option or not, so just need advising. I have a project where by I have multiple servers around the uk, (basic computer configured as a webhost). Each have a mysql database which holds data collected every minute. (its not alot of data, 3 rows, each a few values) Then I have a one central server here with me which has my web application hosted where the user can visit the webpage hosted on the central server and look at data from any one of the databases scattered around uk. The way in which im currently doing this is having the remote basic servers that collect data open port 3303 which allows me to directly access the SQL database from the central server, but I have a feeling thats not really how it should be done, plus it leaves an open database port available, or is it ok to do it this way? The reason I did it like this was so all code is managed here on the central server, all it is doing is collecting data directly from the servers as and when. The other option I can think of is to have a php file sit on each server that simply requests the data and saves them into an array. This file can then be INCLUDED into the webpage on the central server? So when the user logs on and wants to look at a certain servers data, it will include the remote php file which collects the data locally? This though does mean if i want to make any changes to the whole thing, I would need to somhow change all the php files that reside around the uk on the servers, not a huge deal as I can just remotly take over the servers and thansfer new files but more work nonetherless. The other way I thought would be similer to above, except dont INCLUDE it, but have the remote php file post back the data from a request. I am litterally not sure which is correct, or if it matters? Or if there are better ways Hope you help. Thanks Andy
  13. Hi, at the moment i have a form, that submits to itsself (so reloads the page but via submitting), well basicially im trying to get the submit to happen every 1 min automaticallly. How can i do this? Thanks
  14. Its ok, ive managed to find my brain (i think). I now have 1 table with 10 columns of data. One query gets the data from 10 columns and then i simply do the standard *half pusedo code.* while ($row = mysql_fetch_array($result)) { for ($i=0 to 10) { if $dataselected[$i] == true { put the data into arrays. } } } So this works, the question is now, will this be more optimised than the original code of having 10 tables and doing 10 queries? Thanks
  15. Hi, ok ill try explain what im trying organize. Basically the data is *values* come out of some hardware, thats all done on a server using some software, and then the "data" is inserted into an sql database for use online, charting ETC. So the data being inserted is 10 x Different values every hour. And on a web page i want the user to select which data they want to look at, so a choice of 1 to 10, but its a multiple, could select 1, could select them all. Displaying them is then beyond this, but the data would be pulled from the mysql and placed in arrays. So the way i did it before was one DB, 10 tables each with one column called "value". The 10 lots of values where inserted every 30 mins, and i programmed it so the user could select any amount of the 10 and look at them. I did this by a simple loop from 1 - 10, which per loop check if the user selected this one, if it did it went ahead and queried the database based on the table number from the current loop index and got the column data back and put them into an array. It then continues with the loop until exhausted. But i then released this is currently using 10 queries per page,if i had many users at once this means lots of queries, and the "10 lots of values" maybe increased more over time, meaning more queries. So i though it would be better to have 1 table, with 10 coloumns holding the data to do the same, but only using 1 query, but im having issues getting the "selected" data back and into arrays, and why im here Hope this helps. Andy
×
×
  • 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.