Jump to content

Jfisher446

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jfisher446's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Both sound like great ideas. I'll give them a try and kudos for the help!
  2. That works. It actually works very well. The only complaint that I have is instead of AaBbCc, it's putting the lowercase first (aAbBcC.) I would prefer it to be caps first, what I've done to get it how I want is put it together as a string, then strrev($string). Is there a more correct way of doing it?
  3. Looking all around the web for an answer on how to sort this out to no avail. I only hope there is a solution and someone can help me find it. I have a string, for example: AbABCC I want to sort it so all A's (upper or lower case) are together and all B's and so on. Like: AABbCC Now this I understand that something like this is normally a homework assignment, but this is not. I am working on a genetics program and need the genotypes, whether they are a Wild (A) or mutant (a) to be together so that I can tell that Aa result is het for a mutation. I've tried converting to ascii and back but it gives me the ABCDabcd result. Any other thoughts?
  4. I am trying to get prices imported into a table. I set the type as Integer but it is rounding up the decimals as opposed to including them. I read the mysql manual regarding numeric types and from what I can tell I need to change the precision of it but theres not an option for that so I simply think that I am reading the wrong sections and can't find what I need. How can I keep the decimals in the data? Also is there anyway when pulling the prices from the table to include commas (some data is in billions of dollars)? Thanks in advance
  5. I just dont know how to put this into code. I want to do: $dupetablequery = "SELECT * FROM UsedInvTypes WHERE typeID = $typeID"; $duperesult = mysql_query($dupetablequery); "if no records found..." What is the statement for that? How does the result return if nothing was found??? Thanks
  6. nevermind, that one did it...there was a prob with the database. all better. THanks
  7. You could have a php file for the db connection and just include it on every page that needs the connection. [code] <?php include "dbConnect.php"; do whatever ?> [/code]
  8. hmmm... i dunno whats going on now...just focusing on getting rid of the last line is what im doing. What i get when i run it now...still is [quote]out of loop TYPEID = [/quote] [code] while (!feof($fp)) { $mydate = gmdate('Y-m-d H:i:s'); $line = fgets($fp, 1024); //use 2048 if very long lines $lastlinetest=trim($line); if (!empty($lastlinetest)) { list ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,$jumps) = split (',', $line); $fileinsertquery = "INSERT INTO marketData (price,volRemaining,typeID,range,orderID,volEntered,minVolume,bid,issued,duration,stationID,regionID,solarSystemID,lastUpdated) VALUES ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,\"$mydate\")"; $result = mysql_query($fileinsertquery); $fp++; } } echo "<BR>out of loop TYPEID = ".$TypeID."<BR>";[/code]
  9. I am reading a text file, which is a comma separated database. The first line in uncontrollably a list of column names which I do not want to read and put into the database. The last line is a blank line when I open it in notepad it has a space character in on it and that is all. I am using a script to read the lines one by one and input them into a database via sql. I need to not read this last line as it will set all my variables to nothing since theres nothing in the line, but i need to read what one of the variables on the last line was. How can I simply skip inputting the first and last lines? I dunno what the last line # will be as the length varies. [code]$fp = fopen($destination."".$file['name'],'r'); if (!$fp) {echo 'ERROR: Unable to open file '.$file['name']; exit;} while (!feof($fp)) { $mydate = gmdate('Y-m-d H:i:s'); if ($newline != "") { $line = fgets($fp, 1024); list ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,$jumps) = split (',', $line); if($price != "price" || $price != "") { $fileinsertquery = "INSERT INTO marketData (price,volRemaining,typeID,range,orderID,volEntered,minVolume,bid,issued,duration,stationID,regionID,solarSystemID,lastUpdated) VALUES ($price,$volRemaining,$typeID,$range,$orderID,$volEntered,$minVolume,$bid,$issued,$duration,$stationID,$regionID,$solarSystemID,\"$mydate\")"; $result = mysql_query($fileinsertquery); $fp++; } } } fclose($fp);[/code]
×
×
  • 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.