Jump to content

phpnewone

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpnewone's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello. I am just trying to sort an array alphabetically. Here's the code I'm using: function GetAssocCharities($registrationNo) { $db = ConnectionString::ConnectTo_www_ago_mo_gov_data(); $sqlstring = "SELECT * FROM charityPartners where RegistrationNo LIKE '$registrationNo' ORDER BY Name"; $results = @mysql_query($sqlstring); $org = null; while ($resultArray = mysql_fetch_array($results)) { $temp = new Registrants($resultArray['ARegNoFormatted'], $resultArray); $org[] = $temp; } return asort($org); } When I try to loop through the array using a foreach loop, I get an error that Invalid argument supplied for foreach(). Here's my foreach loop: $lstCharities = OrgQueries::GetAssocCharities($registrant->RegNoFormatted); foreach($lstCharities as $c) { //dom something here } I'm sure its something with not understanding list v array or something or that nature, but I'm not having much luck figuring it out with google. Thanks!
  2. WHen I remove ../, I get an error that the file isn't found. Also, this code worked before I moved the page that calls the query.
  3. It's still inside the www folder.
  4. The only thing I changed was moving the file from the Pages folder to outside of it, and changing the require_once statement like so: require_once('../Queries/CharityQueries.php'); to require_once('Queries/CharityQueries.php'); I attached a screenshot of the location of these files. Thanks! ***Sorry, don't know why my screenshot didn't come through. [attachment deleted by admin]
  5. I don't think that's the problem. The page (charity_search.php) that I moved calls a query (CharityQueries.php) which calls the connection string (ConnectionStrings.php). The only thing I changed was moving the file charity_search.php and then the require_once path of the CharityQueries. I did not move CharityQueries which is why I can't understand why the error isn't thrown until CharityQueries was calling the ConnectionString. Thanks!
  6. I have a page that was working perfectly. I decided to move that page. Once I did that, I changed my require_once statement to reflect that the page had moved. Although the paths seem correct, I am getting this error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '../../../data/MoStopsDEV/ConnectionStrings.php' (include_path='.;C:\Program Files\Jcx.Software\VS.Php\2008\php 5\pear;C:\Program Files\Jcx.Software\VS.Php\2008\') I researched this error but am not able to find anything helpful. Any ideas?
  7. What in the world am I doing wrong? $percentFormat is 0.093. $totalExpenses is 1,113,451.00. $numAdminCost = ($percentFormat * $totalExpenses); $numAdminCost ends up being 0.093. I've googled this and tried some different solutions but am not having any luck. I'm sure there is a bonehead error somewhere. Please and thanks.
  8. I'm not sure what I'm doing wrong. I have a date in a table which is formatted as: 2010-08-13 00:00:00. I am trying to change the date through PHP to display as 08-13-2010. The date is being formatted as 12-31-1969. Here's my code. if($registrant->StatusDate != '0000-00-00 00:00:00') { $formattedDate = date('m-d-Y', $registrant->StatusDate); $statusDate = ' as of ' . $formattedDate; } Can anyone advise me what I am doing wrong? Thanks!
×
×
  • 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.