djanim8
-
Posts
42 -
Joined
-
Last visited
Never
Posts posted by djanim8
-
-
will this sort the whole array?
I don't completley understand what was going on in that function LOL
first variable is the array ($a) and the second is what to sort on? I need it to sort on 2 "colums" in the array.
-
OK I don't know if I'm tired or what, but I can't figure out this array multisort thing..
I have a bunch of records with songs that were requested, selected by DISTINCT and then getting the number of records of each song, then inputing this data:
$requestArray[$arNum] = array($songCount, $countRow['title'], $countRow['artist'], $countRow['disc'], $countRow['track'], $countRow['genre']);
Then I want to sort it by the genre, and the songCount like this:
array_multisort($requestArray[5], SORT_ASC, SORT_STRING, $requestArray[0], SORT_NUMERIC, SORT_DESC);
And it won't sort... so what am I missing, what am I doing wrong?
btw.. for some reason it it does this on the very first row:
Genre_____________________Artist__Song__Disc____________________Track_______# Reqs
Country - 2000 - Vol. 14______17_____6____Cross Canadian Ragweed___Country______
when it should look like this:
Genre______Artist__________________Song__Disc___________________Track____# Reqs
Country____Cross Canadian Ragweed___17___Country - 2000 - Vol. 14___6________1
and I have NO idea why, it only does it on the sort...
-
ok I've checked out samspade.org and I get tons of info when I actually type in an IP.. but when I put a link in the code to try to strip apart the code and get the domain, it says this:
That information isn't in the cache
For example, tried getting it with this: http://samspade.org/whois/74.6.25.34
is there another link that would display in the data so I can read it? like http://samspade.org/whois/?ip=
or something?
-
ok I can get the IP address, I'm doing that now, should I search for "sam spade" to reverse it to the domain? I'm unsure what that is...
-
Is there anyway to get the user's domain they are looking at a website FROM
I.E. I'm on the road runner domain.. is it possible to get my domain when I view a website I've developed?
-
ok I downloaded and used the PHP Mailer (http://phpmailer.sourceforge.net/) but I get this error when I try to send an email:
SMTP Error: The following recipients failed:
On their FAQ page (http://phpmailer.sourceforge.net/faq.html#faq1), it says this:
I am getting a "SMTP Error: The following recipients failed [myemail@mydomain]"
I don't know how to fix that.. how would I go about fixing that?
-
btw.. (and this is odd)...
I have another page that is in the root of the domain (http://www.domain.com/) and it DOES send an email to the person thats NOT on the domain...
this code is in a folder called corpevent (http://www.domain.com/corpevent/) and doesn't work....
-
I get this any time I try to send an email to someone that IS NOT in the domain of the company:
Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in corpevent.php on line 21
I have it setup like this (I removed the email address domain...but its correct in the code):
// INI Settings // ini_set(sendmail_from,"info@domain.com"); ini_set(SMTP,"mail.domain.com"); ini_set(smtp_port,"25"); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: info@domain.com"; $to = $_POST['txtEmail']; mail($to,"Your Email",$theEmail,$headers);
Why am I not allowed to send an email to anyone that doesn't have a "domain.com" at the end of the email?
-
they store the same values, the cookie has the same name, just one is stored at the root, and one is stored from a folder that is named "myevent"
I thought cookies worked site-wide... is there any way around this?
-
ok I have 2 pages that save cookies, and one is in a folder called "myevent" (mydomain.com/myevent/) and the other is at the root of the website (mydomain.com/)
Is there any way to get the same cookie to load in both the folders?
here is the code I use to save them:
setcookie("contNumber",$_POST['txtContNum'],time()+60*60*24*30,"","mydomain.com",0); setcookie("emailAddy",$_POST['txtEmail'],time()+60*60*24*30,"","mydomain.com",0);
-
the database is set up that way because it would take to much (there is tons of info for this one) to enter a record for each one.. long story..
I've never sorted an array before.. whats the code for that?
-
yes it is... I was thinking a multideminsional array.. but not sure how complicated that will get.
-
Lets see if I can explain this right....
I have a table with each row containing times.. so colA = 12:00 PM, colE = 2:00 PM, colM = 12:30 PM
and I have these displayed in a printable php page:
12:00 PM - start this 2:00 PM - do this thing sub do this thing: yes 12:30 PM - later thing
what I'd like to do, is figure out a way to SORT them so that it looks like this:
12:00 PM - start this 12:30 PM - later thing 2:00 PM - do this thing sub do this thing: yes
I thought about putting each timed thing into a different record, but that would be way to confusing since each timed event has sub events... and the table is already created
so is there a way I could gather all the information, then sort it by the time
-
nothing in there does what I need...
it should work if its greater than or equal to (>=) date1 and less than or equal to (<=) date2
why doesn't that return anything?
-
ok I have 2 fields in my table, (date1 and date2) with date1 = 2007-08-01 and date2 = 2007-09-30
I'm trying to run this sql statement:
SELECT * FROM discounts WHERE discType = 'Date Range' AND date1 >= '2007-09-15' AND date2 <= '2007-09-15'
and it won't return any rows...
is there a way to see if a date is between 2 days in a table? (btw.. 'Date Range' is valid.. so thats not it)
-
priced fo up to 4 hours
typo. Just so you know.
LOL yea I know, I thought the "FOR" was causing a problem.. thanks!
-
ahhh didn't know that, thanks
-
I've looked over this like 100 times and can't seem to find the error, thought maybe another person could look over it and see what I'm missing...
UPDATE packages SET name = 'Pkg 1. Complete Sound', price = '895', desc = 'Package priced fo up to 4 hours performance time. Package includes up to 3 hours complimentary set-up time, MC service from your chosen Disc Jockey throughout the evening, 2 Professional JBL Powered Speakers, Wireless Microphone, Custom-built Disc Jockey unit with Professional Grade equipment.' WHERE pkgID = '1'
the error I get is:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc = 'Package priced for up to 4 hours performance time. Package includes up t' at line 1
-
I'm going to try this out.. I'll let ya know, hope it works!
-
here is all the code if it helps:
set_time_limit(3600); $handler = fopen($_FILES['fleMusicCSV']['tmp_name'],'r'); $addCount = 0; $totCount = 0; $existsCount = 0; if($_POST['chkDelete'] <> "") { $mySQL = "DELETE FROM songs"; $deleteResults = mysql_query($mySQL); $songID = 0; } else { $mySQL = "SELECT * FROM songs ORDER BY songID DESC"; $getResults = mysql_query($mySQL); $songRow = mysql_fetch_array($getResults); $songID = $songRow['songID']; } while ($row = fgetcsv($handler,1024,",","")) { $artist = $row[0]; $title = $row[1]; $genre1 = $row[2]; $genre2 = $row[3]; $disc = $row[4]; $track = $row[5]; $firstDance = $row[6]; $brideFather = $row[7]; $groomMother = $row[8]; $couplesDance = $row[9]; $boquet = $row[10]; $garter = $row[11]; $songID++; $mySQL = "INSERT INTO songs (songID,artist,title,genre1,genre2,disc,"; $mySQL .= "track,firstDance,brideFather,groomMother,couplesDance,boquet,garter"; $mySQL .= ") VALUES ("; $mySQL .= "'".$songID."','".$artist."','".$title."','".$genre1."','".$genre2."','".$disc."','"; $mySQL .= $track."','".$firstDance."','".$brideFather."','".$groomMother."','".$couplesDance."','".$boquet."','".$garter."')"; $uploadResult = mysql_query($mySQL); if($uploadResult) { $addCount++; } else { echo "There is something wrong on row ".$totCount." and I can't insert this record into the database!<br>"; } echo ""; $totCount++; } fclose($handler);
-
right now I have a CSV file that I'm having users upload and insert the data into a mySQL database..
the file (at this time, it will get bigger and bigger) has over 11,000 lines in it..
The page continually times out.. right now I have the timeout set:
set_time_limit(3600);
it always gives me a CGI error when it gets about 3/4 the way through it... no matter how long I set the the set_time_limit to..
CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers.
does anyone have any suggestions on how to fix this?
-
geez I totally forgot about that LOL thanks!
-
I had another post on here about this, but this is different and I think this is the problem. I have a file field to upload a csv file.. on one page it works fine, on another page it returns NOTHING for the temp name...
here is the code for the form:
<form id="frmAddMusic" name="frmAddMusic" method="post" action="uploadmusic.php"> Upload CSV File of Music: <input name="fleMusicCSV" type="file" id="fleMusicCSV" size="40" /><br /> <input name="Submit" type="submit" id="Submit" value="Upload Music" /> </form>
and the code for the upload stuff:
set_time_limit(600); echo $_FILES['fleMusicCSV']['tmp_name']."<br>"; $handler = fopen($_FILES['fleMusicCSV']['tmp_name'],'r'); while ($row = fgetcsv($handler,1024,"|","\"")) {
the echo for the tmp_name returns nothing..
anyone have any idea whats going on?
-
this is the code for the site thats NOT working:
The fgetcsv error (Warning: fgetcsv(): supplied argument is not a valid stream resource in uploadmusic.php on line 69) for that line is the "while ($row ="....
$fileHandler = fopen($_FILES['fleMusicCSV']['tmp_name'],'r'); while ($row = fgetcsv($fileHandler,1024,",","")) {
This is the code for the site that IS working:
$eventFile = fopen($_FILES['fleCSV']['tmp_name'],'r'); while ($row = fgetcsv($eventFile,1024,",","")) {
problem with date() or strtotime()
in PHP Coding Help
Posted
I think the host of a website I work on upgraded to PHP 5.2.6 without telling us (BAD!)... which has caused some random problems.. most of which are fixed, but this one I can't figure out for the life of me...
I have this line of code:
date('Y-m-d', strtotime("$eventDate + $totalDays days"))
the $eventDate is a date in yyyy-mm-dd format that is pulled from a database (echoed this, it is correct).
the $totalDays is negative number also pulled from a database (-14 is the value now).. I've echoed this and it works fine.
and this statment above ALWAYS returns 1969-12-31 and I can't get it to return anything else...
has something changed and I can't find a solution for?
this has worked for over a year!!