Jump to content

ThunderAI

Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by ThunderAI

  1. Worked great, thanks
  2. I want to do this: How do i make it work $sql2 = "UPDATE tbl_users_queries SET user_q_number = (user_q_number + 1), user_f_rows = '".$rowcounter."' WHERE user_id = '".$userid."' ";
  3. What i tried last night was to store all of the IDs in an array and then remove the duplicates from the array, then you have to reopen a connection to the database to loop through the array. That adds time to the process and is not ideal. I do not see how i can check to see if the ID is already in the array, and if it is not to display the row in one step. what i want is a way to prevent a row that already has been shown from being displayed again.
  4. I am currently working on some code that sorts through a list of things and compares it to a list of other things in three different lists. The sort structure is for each of the different lists > for each item in list a to compare to list x > > While there are matches as govered by the SQL Statement, display the problem is this leads to having the same record in list x repeated multiple times, and i would like to avoid that. I have tried this code: while ($newarray = mysqli_fetch_array($objrs_support, MYSQLI_ASSOC)) { for($j=0; $j<sizeof($known_sids); $j++) { echo $j; if ($known_sids[$j] == $newarray['ruat_tsa_sid'] ) { echo "looping j ".$j; // We already added this guy to the list, do not add again echo "Repeat Customer, Do not add them again<br>"; } else { echo "new j ".$j; $known_sids[$j] = $newarray['ruat_tsa_sid']; When i try this i get an error "Cannot use a scalar value as an array in " which i am sure it is because i am attempting to do a for loop in an array that keeps changing size. How do i block a repeat ID from being displayed across the x number of lists? The intent here was to have $known_sids keep a list of known IDs across all of the different lists and compare a new result to those in the list, if the new ID matched one in the array then dont display it. Help, please
  5. The file can only be received by clicking on a link on the website like file.asp?file=nameofile. There is no way to know the actual location of the file on the server. So it is the file by association i suppose. I gave this code a try, and it tells me it can not find the function, even though i have turned it on in PHP.ini and restarted the webserver <? $url="---URL---"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $store = curl_exec ($ch); $xml = curl_exec ($ch); curl_close ($ch); ?>
  6. I did a quick search for cURL in the PHP manual and it all looks very exiciting; however, I dont know the first thing about anything cURL. From what I can see it looks like if i could feed the cURL the link to the document it might be able to output the file to the screen, which is not ideal since i need the file to download to my server for processing.
  7. What about when one field in a csv looks like this. I know which field it is, and it is always the same one. ,"blah, blah", the field is one field; however, because of the import method it treats it as two. and then the result fields have " at the front of one firld and a " at the end of the other field. I tried to OPTIONALY ", but then all of the cells are NULL when the results are imported.
  8. Now that I was explianed how to download a file from a remote server with a known directory structure, what about downloading a file located in an unknown location, but with a known reference to the location via a download link. For example, How can you program a PHP script to submit a login form automatically, and then process to download a file whos location can only by the download link which looks something like : file.asp?file=xxxxunicodefilenamexxxxx.extention. I know how to form the PHP code to loginto the site automatically, but form there it gets a little problematic. The code then needs to click on a link, and then proceed to downlaod the file to a location without user intervention. 1). How do you tell PHP to 'click' on a link, and; 2). Save the download file. Thanks for your help in advance.
  9. That seems to work just great!, Whats the syntax to skip the first row in the CSV file?
  10. That my friend is awesome. It works.. Now the question is, when i download a .rar file, when the download is over the screen in IE displays the contents of the file which is junk. Can I prevent that from happening so tat the script can continue on to do other stuff?
  11. I have a few MySQL databases running on a 3gb 5200+ server and I need some help changing the config.ini to use up those resources to speed up MySQLs operation. I am currently using the config fiele ment for <64mb of memory and would like either links to a config file for a larger single machine operations or your suggestions on what files ot change to make the server utilize its resources.
  12. The server is on a xampp install for development on a windows machine.
  13. Unfortunately all that does is put a NULL value in every single field in the database. Ignoring the actual values as well. Here is the import code: $objconn_support2 = mysqli_connect("localhost", "---USER---", "---PASSWORD---", "---DATABASE---"); $sql_support2 = "LOAD DATA LOCAL INFILE '----FILE---' INTO TABLE `---TABLE---` FIELDS TERMINATED BY ',' ESCAPED BY ',' LINES TERMINATED BY '\r\n'# Affected rows: 40096"; if (mysqli_connect_errno()) { // there was an error trying to connect to the mysql database printf("connect failed: %s\n", mysqli_connect_error()); exit(); } else { //mysql_insert_id(); $objrs_support2 = mysqli_query($objconn_support2, $sql_support2) or die(mysqli_error($objconn_support2)); }
  14. Im going to need help with Cron, cause i dont even know what that it.
  15. There is a server that updates a known file every day. How do I program PHP using header() or another function to go to this website, download the file and place it in a folder for another script to conduct work on it. From what I can see an read about header() that doesn't seem to be able to do what I am looking for. Is this type of request even possible?
  16. I have a csv file that I would like to import using the LOAD DATA command, the only problem is i can not determine the proper setting for import within PhpMyAdmin. A typical line looks like this 1234,stuf,,more stuf,,,,birthdate,,more stuff When i try to import it using the following line, it skips the blanks, but I really need the blanks in the database. LOAD DATA LOCAL INFILE 'C:\\xampplite\\tmp\\phpC852.tmp' INTO TABLE `tbl_temp` FIELDS TERMINATED BY ',' ENCLOSED BY ',' ESCAPED BY ',' LINES TERMINATED BY '\r\n'# Affected rows: 40096 any other combination that i have tried only gives me NULL in each field. Can anyone please help!
  17. i've done all the timer code, and the php script when run within an iframe inside of a table will run at a mimimum 1 second longer on localhost then when the script is not within an iframe or a table.  That 1 second balloons over the internet. [quote author=Daniel0 link=topic=118982.msg486745#msg486745 date=1166381175] I'm having a hard time believing that the performance decrease is caused by the iframe and td tags, but I might be wrong. Try to make a timer that will output the total execution time and echo it in the PHP script. Then run it in all those three ways a couple of times and take the average time and then you should be able to determine if there is any decrease caused by the tags (which I doubt there is). [/quote]
  18. Hi! I have a php document that runs very fast when not within an iframe, and slows down a little when it is placed within an iframe and then even slower when the iframe is placed within a table. I have tried making the layout completly from CSS, but the iframe slows down within a DIV just as bad as it does within a TD tag. Is there anyway to speed th eperformance of the iframe, or any common tips?
  19. Please help, I cant get anything to work, so no code, sorry. I am trying to get about 8 columns line up using a combination of DIV tags and CSS style rather then using tables and TD's, but I cant get it to work worht a darn. Is there anywhere that I can see an example of this or someone crank out a quick example of what it would look like?
  20. most of it is already a class in CSS, at least the style is.  The problem seems to be how the information is pulled and placed in HTML makeup language. For example: if I just do this [code]while *#(YROFSJFJKFS { ?> <?echo $newarray['fieldb'];?><?echo $newarray['fieldc'];?><?echo $newarray['fieldc'];?> <? }[/code] it is insanly fast, but if I do any styleing to it like [code]while *#(YROFSJFJKFS { ?> <ui><li><?echo $newarray['fieldb'];?><?echo $newarray['fieldc'];?><?echo $newarray['fieldc'];?></li>>/ui> <? }[/code] it slows down considerably, and if I put it in a table, hell I better go get a drink and wait for it to timeout. [quote author=complex05 link=topic=118751.msg485690#msg485690 date=1166215769] Instead of putting so much styling, make use of CSS, and define everything as a class. That should free up about 50% of the coding you have listed above. [/quote]
  21. It looks like it is the way I am formating the result.  If I print just the information from the query without any style it takes no time at all to print, but if I add the styling it takes much longer.  Any clues as to how to fix that problem? [quote author=complex05 link=topic=118751.msg485525#msg485525 date=1166203994] is it the query that's taking the time or the actual script? Try outputting the SQL execution time to isolate the delay. [/quote]
  22. There is no buffering or paging of any kind. From what I have read, I wont beable to buffer the text because all of it is inside of a table.  Oddly enough, I dont understand why the queries take much longer with PHP and MySQL then they do with ASP and Access.. Seems to run countrary to what I expected from the migration. [quote author=obsidian link=topic=118754.msg485568#msg485568 date=1166206126] It may be simply because I did a quick once over of it, but I didn't notice any paging of any sort. Do you have any sort of pagination or buffer for queries that are going to return an inordinate amount of records? That will speed up a data grid immensely. [/quote]
  23. I have thought about this before, it is not too hard to do, i'll give it a shot. Thanks [quote author=taith link=topic=118754.msg485564#msg485564 date=1166206046] secondly... [code] $adataselect[0]   = ""; . . . [/code] is much faster set once [code] $adataselect  = array('','','','',''); [/code] [/quote]
×
×
  • 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.