-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Use mysql_error() to find the error returned. Generally this will help you solve the problem straight away.
-
Sorted it. The problem was the sequence select; moved it before the merge and all the errors disappeared. Thanks for your advice! I've not quite finished the job yet but I think I'll be able to work out the rest on my own now, thanks again! Adam
-
Thanks a lot for the reply. I've been trying to use the merge statement but having a few troubles. This is the code I have so far: merge into merchandise_items mi using dual on (mi.item_id = pItemId) when matched then update set ... when not matched then select merchandise_container_seq.nextval into vItemId from dual; insert ( ... ) values ( ... ); I'm not exactly sure what the problem is, but all the field names, though left out where not essential, are correct and so shouldn't be causing the problem. In SQL developer I'm getting the following errors: Error(1166,5): PL/SQL: SQL Statement ignored > Refers to: "merge into merchandise_items mi" Error(1184,9): PL/SQL: ORA-00905: missing keyword > Refers to: "select merchandise_container_seq.nextval into vItemId from dual;" Error(1185,9): PL/SQL: SQL Statement ignored > Refers to: "insert" Error(1186,9): PL/SQL: ORA-00925: missing INTO keyword > Refers to: "(" - just underneath "insert" I'd be very grateful if you, or anyone else, could take another quick look and see if you can spot what the error is? Thanks again for your help, Adam
-
It's okay, but a little basic... Quick look on Google and I found: http://bmearns.net/wwk/view/Insert_text_into_textarea_with_Javascript
-
Although the script may work, it isn't exactly secure. Consider that cookies can be added / modified so easily, just testing if the cookie has been set isn't secure enough, because they can just add it. There's also the chance of cookie stealing scripts obtaining your login info; you'd be better off using PHP sessions.
-
Try this: header("Location: mailto:" . $_GET['u'] . "@" . $_GET['d'] . "." . $_GET['s']);
-
Realise this is closed now but, you could improve that further: if (strlen($str) == 5) { $pattern = '/([0-9]|1[0-2])(0[0-9]|[1-5][0-9])(am|pm)/'; } elseif (strlen($str) == 6) { $pattern = '/(1[0-2])(0[0-9]|[1-5][0-9])(am|pm)/'; } preg_match($pattern, $str, $matches);
-
Ah, I jumped to the conclusion your ID field was integer.
-
Was there an error? Edit: Didn't see you had modified post.
-
where `id` != 5
-
I don't understand the great need for shorthand workarounds? The odd second or two you may save yourself here n there in future won't count for anything against the many hours you spend looking them up and learning them. Just pick them up naturally whilst learning more useful things... I suppose a good analogy is moving to a new town and trying to find someplace by taking every short cut you find, without going down the main roads a few times first? Ha.. second thoughts perhaps a little corny!
-
<?php $foo = isset($_GET['string']) ? $_GET['string'] : null; if(!is_null($foo)) { echo <<<EOD <table width="1000000"> <tr> <td>You could fit a big table in here!</td> </tr> </table> EOD; } else { echo <<<EOD <span class="whenever">'single quotes as well'</span> EOD; }
-
This isn't actually AJAX, but, basically you need to append the element as a child, or insert it before another element. There's most likely more ways I just can't think of any off of the top of my head. Have a read through a few of the links found on Google for a better idea: http://www.google.co.uk/search?q=dynamically+create+element
-
Using that exact code - except changing the action attribute to the same page - after I click submit the value disappears. What platform have you tested this on?
-
Hey up guys, Working with some procedures in Oracle. I'm not brilliant with PL/SQL syntax yet so I'm a little stuck with this and lack the terminology to search for it properly on Google. What I'd like to do is run a select query that will hopefully return an `item_id`. If there is an item ID then I'd like to run an update, if not, an insert. My code looks like this: select item_id into vItemId from replaced_table where replace_field = pSitecode and replaced_field = pLang and replaced_field = pPageId and replaced_field = pGroupId and replaced_field = pRuleId and replaced_field = pTypeId and replaced_field = pSku; if vItemId <> null then ... else ... end if; However I'm getting a compile error in SQL developer with that, saying that the if statement is unreachable code? To be honest though I don't actually know how to test if the query returned a result, or to test if `vItemId` contains any data (and I'm not entirely sure what value it would have if there was no results returned - guessed null). Could anybody shed any light on this? NB. To be on the safe side of violating my contract I just replaced the table and field names. Thanks Adam
-
What are the possible formats it could be? 24hour possible? leading zeros possible? etc. You certainly don't need all that... Perhaps something like: $str = '530pm'; preg_match('/(0?[0-9]|1[0-2])(0?[0-9]|[1-5][0-9])(am|pm)/i', $str, $matches); print_r($matches); Can make it more accurate once we know all the possible formats though...
-
Neil's right. There are ways to make it difficult though, but you can never make it impossible.
-
Well yeah it's possible, but what are you trying to do??
-
Well, there's your problem? $count isn't being defined. You've posted code from the point where $count is used as well, so can't help you any further at the moment.
-
If you're having problems importing large amounts of data through a web-interface, perhaps consider importing via the command-line - assuming you have access?
-
You could do it like this: while($row = mysql_fetch_array($guests)) { $user_list .= '<span class="activenick">' . $row['alias_name'] . '</span>,'; } print rtrim($user_list, ',');
-
How are you populating the array?
-
Field values need quotes around them if they're strings: $q = "INSERT INTO info_table (add_info_check) VALUES ('{$_info_check}')";
-
You mean something like... <?php $_product = $this->getProduct() ?> <?php if($_product->isSaleable()): ?> <p><img src="img/in_stock.gif" alt="In Stock" /></p> <?php else: ?> <p><img src="img/out_of_stock.gif" alt="Out of Stock" /></p> <?php endif; ?>
-
I assume you mean with jQuery? In what event do you want the fadeOut to occur?