ToonMariner
Members-
Posts
3,342 -
Joined
-
Last visited
Everything posted by ToonMariner
-
If you want to check if the update has happened then check mysql_affected_rows($query) == 0
-
a cms is a Content Management System - its to manage the content of your site.... A template is a template it is used to apply a standard output structure of your site...
-
It's a valid as the hills are old..... If fact that is the way to do stuff - its what class and id were made for. Remeber though you can only use an id once on a page - its not valid to have two elements (ie. two divs) with the same id. This won't stop most browsers from displaying what you want or breaking (IMO it shoudl break though!) but any javascript that works on the content will fail as will html validation.
-
that's a graphic design issue nothign to do with css or html...
-
This is the box model prob again.... Either switch your doctype to xhtml strict (or 1.1) or read this http://css-discuss.incutio.com/?page=BoxModelHack
-
only if php isn't installed and the configuration for both server and php are not correct.
-
swicth the keys on your array and then use multisort like so <?php $values['sum']['ed'] = mysql_result($result, 0, "ed"); $values['sum']['ted'] = mysql_result($result, 0, "ted"); $values['sum']['tom'] = mysql_result($result, 0, "tom"); $values['name']['ed'] = mysql_field_name($result, 0); $values['name']['ted'] = mysql_field_name($result, 1); $values['name']['tom'] = mysql_field_name($result, 2); array_multisort($values['sum'] , SORT_NUMERIC, SORT_DESC, $values['name'] , SORT_STRING, SORT_ASC; ?> Then use foreach($values['sum'] as $key => $val) ..... You can do the rest - I'm knackered and drunk(ish)
-
Need to calculate number of days between dates then return a date
ToonMariner replied to simcoweb's topic in PHP Coding Help
According to SELECT TO_DAYS( '2007-02-17' ) - TO_DAYS( '1976-07-03' ) I am 11,186 days old.... -
Need to calculate number of days between dates then return a date
ToonMariner replied to simcoweb's topic in PHP Coding Help
This is actually something that is more reliable to perform in a mysql query as mysql's support for date calculations is better than php's.... have a read of this page http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html domewhere in there will be an example doing exactly what you need... -
sort multidimentional array (or other best options)
ToonMariner replied to flash gordon's topic in PHP Coding Help
Thats not strictly true roopurt... If you are using year month and day to separate content (like a news archive) and use those parameters in a query then it makes sense to do so. There is no interpretation to perform in php prior to or after any queries and I believe the storgate space required in the database would actually be less in the long term. -
Does your browser detect any js errors?
-
[SOLVED] Stopping background image repeating in a table
ToonMariner replied to the_oliver's topic in HTML Help
You should use either a style sheet or inline style attribute with background-repeat: no-repeat; -
Thast because IE uses ActiveXObject instead - and this is ajax/js question not php.
-
Jesus H.... If you want something doing properly..... It is easier to perform this task as jessie suggest and just have it in a code block that sits inside the html, BUT if you want to put that bit of un-necessary extra load on the server memeory then do this... include("includes/db_connect.php"); $res=mysql_query("select * from tbl_ethnicity"); if(mysql_num_rows($res)==0) { $mssg = "there is no data in table.."; } else { $mssg = '<select name="ethnicity">'; $mssg .= "\r\n\t" . '<option>Select:</option>'; while($row=mysql_fetch_assoc($res)) { $mssg .= "\r\n\t" . '<option value="' . $row['ethnicity_id'] . '">' . $row['ethnicity'] . '</option>'; } echo "\r\n" . '</select>'; } ?> <HTML> <HEAD> </HEAD> <BODY> <?php echo $message; ?> </BODY> </HTML> Now don't you worry about all those \r\n and \t's - they will just make it easier to read your html.
-
perahps a link to your page would help more. what doesn't work 'right' and how should it work.
-
[SOLVED] INPUT BOX FOR INTEGER VALUES
ToonMariner replied to ali_2kool2002's topic in PHP Coding Help
It can't be done.... If you have a text input element on a page and only want numbers in there you have to use javascript. That can be turned off so you shouls always validate the data in the php script accepting it. -
There is one reason I don't like that approach - it means twice as much work keeping your site current. 'One site fits all' is my favorite motto.... The only benefit in providing a purely free mobile zone is if you have produced WML pages...
-
<?php include("includes/db_connect.php"); $res=mysql_query("select * from tbl_ethnicity"); if(mysql_num_rows($res)==0) { echo "there is no data in table.."; } else { echo '<select name="ethnicity">'; echo '<option>Select:</option>'; while($row=mysql_fetch_assoc($res)) { echo '<option value="' . $row['ethnicity_id'] . '">' . $row['ethnicity'] . '</option>'; } echo '</select>'; } ?> That is how I would do it. Well I would break out of php for some of the html but otherwise thats how I'd do it.
-
Exactly right! If I can detect what kind of browser is connecting I can choose what it "sees". Unfortunatley that is 'little' tougher. If you use, as I do, Jesi's method of providing style sheets for different devices then the connecting device picks the one it should use all by itself. There are how ever a couple of exceptions to this which I can't remeber the specifics of; but an example is that one of Nokias devices will always choose the 'screen' type even though it should go for the handheld...... You could check the browser details using get_browser() or maybe even the OS by using posix_uname() and echo out the corresponding style sheet based on some logic. That however would entail you loading your page on a range of devices and seeing what the output is inorder to construct that logic; unless there is a page somewhere (sure there will be) that lists all the major devices and their browser or OS details. I go with the method described by Jesi and don't care about people who buy devices that don't conform to the recommendations provided by W3C.
-
you've lost me on that... :S Pee eye ess ess MySelf Laughing...
-
Displaying Random record from a database
ToonMariner replied to PHPnewby!'s topic in PHP Coding Help
just put 'ORDER BY RAND()' at the wnd of your query. -
<?php function makeRegEX(&$item, $key) { $item = '/^' . $item . '/'; } $postcode= "M23 4EF" $arr = ('SW','NW','SF'); array_walk($arr, 'makeRegEx'); if (preg_match($arr,$postcode)) { echo "Found"; }
-
where is $facials set? if you have 'facialsprice' in your html....
-
Security - SQL injection - Cross-site-scripting
ToonMariner replied to maverick5x's topic in PHP Coding Help
What makes you suspect so? Perhaps you store the strings people are entering and then you can look at what is going on...