AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
1. what errors do you receive? 2. some of your syntax is incorrect for doumentation on the mail function
-
the undefined index notices will not hinder your script, however they should ebe addressed, bascially it is telling you that the indices of the given arrays do not have values, this is becuase you are not checking if they are set first before initiating them..as for the undefined variable error, you are setting the variable inside of a coinditional statement, then trying to echo the contents..most likely the $msg variable is not getting set to a value before you are trying to output its value
-
I agree with masterace in that you should check if its set to avoid the notice, and with muddy_funster in that you should change the timezone in your php.ini file for convenience
-
remember that the majority of people that come here are amateurs at coding, if you tell them to use the @ suppressor here, they are more then likely to start using it everytime that don't want to see an error..which in itself can cause many more errors and missed errors..
-
Help getting data from db and putting into array needed.
AyKay47 replied to seany123's topic in PHP Coding Help
not even entirely sure what you are asking, however if looks like you are trying to put db values into an array..? why not use mysql_fetch_array or another mysql_fetch built-in function that the framework provides.. -
i recommend that you avoid using globals...food for thought http://blog.case.edu/gps10/2006/07/22/why_global_variables_in_php_is_bad_programming_practice
-
i wouldn't recommend using the @ suppresor in this case simply because it is a bad habit to get into, however I do agree that you should adjust the default timezone in your php.ini file to avoid having to manually change it in all of your files..
-
why cant you use operators? you can use the between clause if you absolutely don't want to use an operator
-
no problem, please mark this as solved, lower left of thread
-
you are telling the server to only grab loc_id from the locations table...specify what you want it to grab.. SELECT estimates.loc_id, locations.company_name, estimates.example COUNT(*) FROM estimates LEFT JOIN locations ON estimates.loc_id = locations.loc_id WHERE date BETWEEN '$reportdatefrom' AND '$reportdateto' GROUP BY loc_id;") insert the correct field names in place of what I have added of course
-
no problem, always look for ways to combine your queries to produce the same results...multiple queries consume more memory and slow your server, thus response time
-
no pain at all.. no problem
-
use the AND clause SELECT * FROM $dbname WHERE ring=1 AND earrings = 1 AND pendant = 1 AND cab = 1 AND bead = 1 AND new = 1 AND sold = 0 ORDER BY new DESC, itemno ASC your computer will thank you
-
the link that I provided has numerous examples and documentation on the purpose of each type of JOIN..can't add much to it.. however you probably want something like this SELECT loc_id FROM estimates LEFT JOIN locations ON estimates.loc_id = locations.loc_id
-
you can style your images with the css attribute... text-decoration: none; this will remove the link color..
-
no you want to wrap the image tags inside of the anchor tags.... like this.. <div style="float: left;"><a href='test.php'><IMG HEIGHT="90" WIDTH="320" IMG SRC="b1.jpg" style="float: center;"/></a><a href='test.php'><IMG HEIGHT="90" WIDTH="401" IMG SRC="b2.jpg "style="float: right;"/></a><a href='test.php'><IMG HEIGHT="90" WIDTH="320" IMG SRC="b3.jpg "/></a></div> Note: in my first post I miswrote the closing anchor tag...should be </a> not <a/>
-
look into using a JOIN here
-
preg_replace for submitting email into MySQL database?
AyKay47 replied to jdowen2211's topic in PHP Coding Help
well you wouldn't really want to use preg_replace on an email...as it can strip characters that will make the email useless...however if a user includes unwanted characters invalid to an email address, the email address is obviously invalid anyway...heres a pattern to be used with preg_match $pattern = '~[a-zA-Z0-9-_.]+@[a-zA-Z]+\.[a-z]{2,4}~i'; $subject = 'example.test@example.com'; if(preg_match($pattern,$subject)){ //if TRUE, a match has been found print "valid email"; }else{ print "invalid email"; } now there are a couple ways to limit the extension and host, however this is a simple and fairly secure pattern to use.. -
add an anchor tag to each...? <a href='test.php'><a/> note: center != centre
-
i don't see the difference in using jquery as opposed to js here..perhaps if you explain your reasoning
-
i dont know your logic here, depends on when you want this to be executed..
-
Huh? If you have the url to an image, you can access the image. I'm not sure I understand what you are trying to say here AyKay... Of course I'm not clear on what the OP wants. I thought he had an xml feed of some type and just wants to get the img url that's contained in the CDATA. honestly the OP has confused me..
-
foreachloop
-
theres a gap but it is not huge and looks like it should be there