
jaymc
Members-
Posts
1,521 -
Joined
-
Last visited
Never
Everything posted by jaymc
-
That doesnt work Its not physically visible when echoed out or even in a database Its like a hidden char which only has relivence in a browser URL or as a line break Therefor doin an str_replace or ereg_replace wont detect it
-
The txt file is generated from a bespoke program I need to achieve this in PHP
-
Because it doesnt show up as %0D in notepad or when echoing it I only found it out when it was displayed in the browser and I noticed that char appearing at the end Its like an invisible character anywhere else apart from in an address bar Or if its in notepad it will just insert a new line. I suppose its like \n How the hell can i get rid ofr this its driving me crazy
-
I have a text document which i use php to strip data from One stage it strips someones name, however, there name contains a hidden character and after further investigation ive found it to be the html eqivelent of %0D Which is apparently a line feed How can I use PHP to strip it out. Please note that its not actually displayed as THERENAME%0D But I know its there Thanks.
-
What does the * represent? Is it always *
-
Is that know to be the best/fastest way to achieve a count of rows?
-
Ive been doing MYSQL for a while but Ive just been reading a topic on here and realised you can select data from numerous tables in one query by adding the tablename.field Just wondering, is this quicker than having 2 seperate queries and if so is it dramatically quicker in the sense of 50%? Even if it is in mili seconds Feedback please
-
I want to count how many rows in a database match a members username Whats the best way At current I basically have $q = "SELECT `id` FROM `table` WHERE `username` = 'fred'"; $num = mysql_num_rows($q); Is that the fastest and less intensive way to count?
-
I have made a php script that reads a text file, explodes bits of data from it and puts it into a database One of the fields is `manager` The managers name is retrieved from the txt file and dumped in the database, works fine!! Now, I tried to use a query to return all results WHERE `manager` = 'their name' It didnt work, the code was fine, I tested it with other fields and it was fine, just not manager After further investigation, using phpmyadmin I edited the row, then saved it, so basically it updated the row but with all the same info It then started working!!! With that in mind I can only assume its a character set issue For example, a normal space by pressing the same bar looks exactly the same as doin ALT0160, however, they are not both spaces, the ALT0160 is an invisible character Maybe its something like that... But yeh, in phpmyadmin I can see manager = their name but when I search for it, it comes back with no results, I even copied it from phpmyadmin to make sure it was the correct characters, but didnt work I then clicked on edit, clicked on save, and then it works coming up in the searches, so obviously phpmyadmin is converting the character set to the correct one.. I know its crazy, but I hope ive explained it well enough Feedback would be great!
-
Cheers!! Resolved
-
How can I turn 04 into April I tried date(F, 04); but it obviously wants the day and year aswell for that to work which in my script wont be available The work around is just have a load of if statements, but thats not very practically Any simplied function or way around it 01 = Jan 02 = Feb etc..
-
I dont have a slow query log I had one, but it was useless When the server load goes up to 30.... any query can take 20 seconds to finish for the simple reason its in a que MYSQL cant distinquish between that, it treats it as a slow query when in actuallyfact its running slow because of the system resources, not the actual nature of the query
-
Ok, that word great However, lets say I have 2 main pages Mainpage A Mainpage B Both can launch the pop However, I want to force the popup to load the content in Mainpage A If Mainpage A does not exist (browser has been closed) and the popup was launched from Mainpage B, I dont want it to launch it in Mainpage B, I want it to launch it in a new window Thats why I was on about assigning a name So basically if launcher was Mainpage A, load content in Mainpage A, if it wasnt Mainpage A or Mainpage A doesnt exist, load content in new browser Any idea?
-
I have a webpage (A) I want to launch a popup (B) from that webpage, in the popup will be a link When clicked, I want the link to open up inside of the original webpage (A) Do I need to assign it a javascript name or something Window.name=''? Please advise Thanks
-
I run a very very busy website which uses MYSQL heavily I have tried my best to index tables correctly, optimize queries as best as I can and run regular defrags of tables However, MYSQL still goes wild sometimes when the site gets busy and causes the server load to fly from a steady 4.0 to 212 (when running top) When this happens a quick check of the MYSQL process list shows about 40 queries, most of them locked Some of them have even been running/locked for 240 seconds The load will stay like that untill the queries clear These queries are normal ones, in other words, its not some heavy query thats doin it, basically, any query appears to be setting it off, and once when locks obviously the rest follow and just que Here are the specs of my server, which is my own, and used only by me 2x 1.4Ghz Opteron 3Gig Ram 1x SATA with SYSTEM and MYSQL files on 1x SATA for data I have tweaked the mysql conf as best as I can, but here it is anyway On the server I run 3 seperate sites, if you want to call them that One is an invision 2.2 forum which usually has 100 active members hourly.. Another is a chatroom which usually has 50-60 people in the chat And the other is a member website which usually has 550 people online #DO NOT MODIFY THE FOLLOWING COMMENTED LINES! #Created with ELS from www.servermonkeys.com #els-build=4.1 [mysqld] datadir=/var/lib/mysql skip-locking skip-innodb skip-networking skip-name-resolv safe-show-database query_cache_limit=3M query_cache_size=128M ## 32MB for every 1GB of RAM query_cache_type=1 max_user_connections=440 max_connections=440 interactive_timeout=60 wait_timeout=30 connect_timeout=10 thread_cache_size=2M key_buffer=1024M ## 128MB for every 1GB of RAM join_buffer=12M max_connect_errors=20 max_allowed_packet=16M table_cache=5024 record_buffer=6M tmp_table_size=196M sort_buffer_size=12M ## 1MB for every 1GB of RAM read_buffer_size=3M ## 1MB for every 1GB of RAM read_rnd_buffer_size=3M ## 1MB for every 1GB of RAM thread_concurrency=4 ## Number of CPUs x 2 myisam_sort_buffer_size=128M server-id=1 collation-server=latin1_general_ci old-passwords #log-slow-queries=/etc/slowq.txt #long_query_time = 5 [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/lib/mysql/mysql.pid open_files_limit=102400 [mysqldump] quick max_allowed_packet=16M [mysql] no-auto-rehash #safe-updates [isamchk] key_buffer=356M sort_buffer=356M read_buffer=356M write_buffer=356M [myisamchk] key_buffer=356M sort_buffer=356M read_buffer=356M write_buffer=356M #[mysqlhotcopy] interactive-timeout The reason I have used more than average memory for things is due to the amount of RAM I have and the fact it never ever goes into SWAP, so I assume if its not swapping I can afford to use more of it Its CPU usage that is the killer, the server is almost constantly between 60-89% Any help would be great!
-
I have the following data to work with Jamie McCoy 08:29:36 19 0 1 401 9.0 399.6 1 14 60 0 1 It will always be in that format with each set of information in the above order, but may contain different names or numbers.. What I need to do is put each bit of information in an array, I usually use explode but as you can theres no much to explode by apart from the large white spaces between each bit of data However, sometimes the white spaces may be a little large, for example, 5 white chars instead of 8 white chars (depending on the amount of space there name takes up, See Example Jamie McCoy 08:29:36 19 0 1 401 9.0 399.6 1 14 60 0 1 Jay George 08:28:12 1 0 0 172 19.7 172.0 0 6 94 0 0 John Burquest 08:26:57 24 0 1 413 8.7 374.5 35 37 30 3 1 So, how can I basically get it so I can have $s[0] = Jamie McCoy $s[1] = 08:29:36 $s[2] = 19 etc... Is explode the only really way to split the data up?
-
I am creating a php script which will feed in some text from a textarea and produce an output The issue Im stuck with is getting rid of returns, Here is an example of what I want the code to do and the result it should give in raw data which is essentually to remove the page breaks. However, the code Ive give doesnt work How can I achieve this $statsb = str_replace("\r", "", $stats);
-
I have indexes in the appropriate places Can you explain what a covering index is, or is it essentually, a standard index
-
I have a huge table that records which members have viewed someones profile and the time At this moment it has accumulated over 1 million rows Im worried that when that table is accessed it will basically blow mysql up (kidding) Here are the queries executed in relation to the table $queryj = "SELECT `viewer` FROM `viewedpro` WHERE `username` = '$_GET[user]' ORDER BY `time` DESC LIMIT 0,10000"; $queryj = "SELECT `viewer`, `views` FROM `viewedpro` WHERE `viewer` = '$User_Session' AND `username` = '$_GET[user]' LIMIT 0,1"; $queryl = "UPDATE `viewedpro` SET `views` = '$hits', `time` = '$time' WHERE `username` = '$_GET[user]' AND `viewer` = '$User_Session' LIMIT 1"; Note that the 10,000 limit is because I now at the moment no member would have had 10,000 unique visitors The rest out Limited to 1 Will this be ok or is is destened to kill my server due to the size of the table
-
Yeh I actually caught that googline, Its just to make Youtubes on flash module loop, nothing to do with object really
-
Please help, this is driving me crazy? Can someone prove you can loop audio using OBJECT
-
Ive changed it all now and removed root Cheers
-
What guest account Will that be a linux user?