Jump to content

croakingtoad

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.croakingtoad.com/

Profile Information

  • Gender
    Not Telling
  • Location
    USA

croakingtoad's Achievements

Member

Member (2/5)

0

Reputation

  1. never mind...changed the way i was doing it.
  2. Greetings! I am querying a database and after a little magic it outputs a variable called - $HomeStyle Now, this is a migration script so I am migrating from a database that has a field length of 3000 to a database that has a field length of 250. Here's a sample value: $HomeStyle= "Adirondack-style,Cabin,Cedar shake,Conventional,Cottages,Farmhouse,Lake"; //Obviously this is less than the needed field length, but let's just pretend so we can save space! So how would I take the value of $HomeStyle, reduce it to 250 AND eliminate any characters after the last comma (including the last comma)? (So we don't have incomplete words.) Thanks for your guidance!
  3. great, but how do I get it to only return the first 10 characters in $new?
  4. I have a var named $DeveloperTelephone that is being pulled from a database and the string value could be formatted like-- 540-111-1111 (540) 111-1111 866-111-1111 or 828-111-1111 I need to first remove all the dashes and parents and then count the first 10 digits to make that the new value. So the third value above would become-- 8661111111 How would I accomplish that please and thanks?!
  5. I tried nickk's version but when I use the following-- foreach ($SVarray as $varName => $varVal) { $$varName = $varVal; echo "$DevName"; } it echoes out the value of the first rows column through every iteration instead of different values for $DevName. What do I need to change to have it assign the current columns value for that row in each iteration?
  6. Is there an easy way (other than manually setting the vars) to set var names as the database column name? I have a database that I am querying and then turning into an array like below-- # perform the query $SVresult = mssql_query($SVquery) or die("Cannot query database"); # fetch the data from the database $SVarray = mssql_fetch_array($SVresult) or die("Cannot process array"); $SVcount = count($SVarray); echo "Count: $SVcount <br /><br />"; # begin master loop through array for ($i = 0; $i <= $SVcount; $i++) { //print "$SVarray[$i]<br>"; print_r("$SVarray[$i] <br />"); } #end master loop through array Instead of having the vars returned having a value of say $SVarray[1] instead having a value of ColumnName or ColumnName[1]? Hope that makes sense. Thanks!
  7. I am able to execute this command through MSSQL - insert into LotPricing values(500,500,500) but when I try to execute it through PHP I get the following error-- Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> ADODB.Recordset<br/><b>Description:</b> Operation is not allowed when the object is closed.' in D:\hosting\member\croakingtoad\site1\test.php:47 Stack trace: #0 D:\hosting\member\croakingtoad\site1\test.php(47): variant->Close() #1 {main} thrown in D:\hosting\member\croakingtoad\site1\test.php on line 47 Here's the code I have-- //create an instance of the ADO connection object $conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); //define connection string, specify database driver $connStr = "PROVIDER=SQLOLEDB;SERVER=".$ovServer.";UID=".$ovUser.";PWD=".$ovPass.";DATABASE=".$ovDB; $conn->open($connStr); //Open the connection to the database //declare the SQL statement that will query the database $query = 'insert into LotPricing (PriceLow,PriceHigh,Description) VALUES (500,500,500)'; //execute the SQL statement and return records $rs = $conn->execute($query); /* Line 47 */ What am I doing wrong here? The table has 4 columns- PricingID, PriceLow, PriceHigh, Description PricingID is a unique key with Identity turned on, i.d. start is 1 and i.d. seed is 1 Please help! Thanks!
  8. I had another developer send me a backup of a database but it doesn't appear to be a sql dump. It was in a zip file but when uncompressed the file is a .bak file. I tried opening it with a text editor and it isn't a text file like a .sql file would be. Any idea what I have here? I know from them it is a mysql backup but I don't want to look like a fool and ask them what it is. And then how do I go about restoring it?!
  9. That only allows you three comparisons...I want the full five they offer only on their own site.
  10. I've tried several times to get this to work and nothing I have tried has been successful. I want to scrape the below url-- http://www.alexa.com/data/details/traffic_details/instantaction.com?site0=virginia.edu&site1=vt.edu&site2=ncsu.edu&site3=psu.edu&site4=umd.edu&y=r&z=3&h=300&w=610&u%5B%5D=virginia.edu&u%5B%5D=vt.edu&u%5B%5D=ncsu.edu&u%5B%5D=psu.edu&u%5B%5D=umd.edu&x=2008-03-20T13%3A39%3A43.000Z&check=alexa.com&signature=53LsuknqIBOvifzf%2FUFCNr6WyLI%3D&range=6m&size=Medium for the following image to write to my own server once a day-- <img src="http://widgets.alexa.com/traffic/graph/?r=6m&y=r&z=3&h=300&w=610&u%5B%5D=virginia.edu&u%5B%5D=vt.edu&u%5B%5D=ncsu.edu&u%5B%5D=psu.edu&u%5B%5D=umd.edu&x=2008-03-20T13%3A40%3A54.000Z&check=www.alexa.com&signature=VH1glT4ZwCzDnpmKzXEEsG9isNs%3D" id="alexagraph"/> I've tried using the tools found here-- http://www.troywolf.com/articles/php/class_http/ but haven't been able to get anywhere. I'll post what I had below-- $http = 'http://www.alexa.com/data/details/traffic_details/instantaction.com?site0=virginia.edu&site1=vt.edu&site2=ncsu.edu&site3=psu.edu&site4=umd.edu&y=r&z=3&h=300&w=610&u%5B%5D=virginia.edu&u%5B%5D=vt.edu&u%5B%5D=ncsu.edu&u%5B%5D=psu.edu&u%5B%5D=umd.edu&x=2008-03-20T13%3A39%3A43.000Z&check=alexa.com&signature=53LsuknqIBOvifzf%2FUFCNr6WyLI%3D&range=6m&size=Medium'; $uri = urlencode($http); echo "Step 1<br /><br />"; require_once("assets/php/class_http.php"); $h = new http(); if (!$h->fetch($uri, "daily")) { echo "<h2>There is a problem with the http request!</h2>"; echo $h->log; exit(); } and here's the response I rec'd- New http() object instantiated. -------------------------------- fetch() called url: http%3A%2F%2Fwww.google.com%2Flogos%2Fspring08.gif Filename: /www/virtualhosts/www.dashboard.unirel.vt.edu/http_5f3bca03a10708837ce5ed5e2500b772 getFile_ts() called /www/virtualhosts/www.dashboard.unirel.vt.edu/http_5f3bca03a10708837ce5ed5e2500b772 does not exist cache has expired getFromUrl() called Could not open connection. Error -1215900454:
  11. Awesome, thanks for the help! SOLVED
  12. That's a good start but I need some logic in there to determine which was is the newest and order them to oldest. An if/else strategy may not be the most efficient way to do that?
  13. I am starting with three chunks of code wrapped in a <li> and want to order it based on a date in a variable. Here's what I have for variables in a separate file that is called in with require_once() - $hkLongDate = "02/25/2008"; $vtLongDate = "02/27/2008"; $totLongDate = "02/29/2008"; The code that I want to sort based on the above date is basically three <li> items like below - $hkList = "<li>Item Blue</li>"; $vtList = "<li>Item Orange</li>"; $totList = "<li>Item Green</li>"; I'm just not sure of the best way to associate the var from the first list with the var from the second list and then have it sort by the date value in the first var. Advice?
  14. I just realized I can substitute $_POST for $values. Works like a charm!!! Thanks so much!
×
×
  • 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.