Re: [PHP-DB] Re: Help with JOIN query

2008-03-06 Thread Graham Cossey
On Fri, Mar 7, 2008 at 12:27 AM, Jonathan Crawford <[EMAIL PROTECTED]> wrote: > I think this is what you mean. You just want the timestamp and action from B > in addition to something from A (I guessed product_ref), right? The MAX() > function should take care of getting the latest timestamp. >

Re: [PHP-DB] Help with JOIN query

2008-03-06 Thread Graham Cossey
On Thu, Mar 6, 2008 at 10:59 PM, Gary Wardell <[EMAIL PROTECTED]> wrote: > Ahh, to bad, I started using it with 5.0. I'm also a long time user of SQL > Server. > > Sorry if I caused confusion. > > Gary > You were getting my hopes up there Gary :-( -- Graham -- PHP Database Mailing List (h

Re: [PHP-DB] Help with JOIN query

2008-03-06 Thread Graham Cossey
On Thu, Mar 6, 2008 at 9:54 PM, J. Hill <[EMAIL PROTECTED]> wrote: > I may be a little confused: the desire is to return all the rows from > TableA that match the record_id of a row in TableB that has the MAX > timestamp? > > If so, why not something like: > > SELECT * FROM TableA a, TableB b W

Re: [PHP-DB] Help with JOIN query

2008-03-06 Thread Graham Cossey
On Thu, Mar 6, 2008 at 6:54 PM, Krister Karlström <[EMAIL PROTECTED]> wrote: > Hi! > > > Graham Cossey wrote: > > > TableA > > record_id > > product_ref > > > > TableB > > timestamp > > record_id > > action > >

[PHP-DB] Help with JOIN query

2008-03-06 Thread Graham Cossey
I can't see how to accomplish what I need so if anyone has any suggestions they would be gratefully received... I'm using mysql 4.0.20 by the way. I have two tables : TableA record_id product_ref TableB timestamp record_id action I want to create a SELECT that joins these 2 tables where the JO

Re: [PHP-DB] date problems

2007-09-07 Thread Graham Cossey
"This DID work, but I recently switched hosting companies..." Is the new server in a different country with a different date format / time zone? Just a thought ;-\ On 9/7/07, Instruct ICC <[EMAIL PROTECTED]> wrote: > >From: "Instruct ICC" <[EMAIL PROTECTED]> > >And while not trusting your index

Re: [PHP-DB] Re: RSS/XML

2005-12-18 Thread Graham Cossey
On 12/16/05, El Bekko <[EMAIL PROTECTED]> wrote: > Henry Ortega wrote: > > I want to put a website's RSS feed on my website. > > For example, > > http://beccary.com/feed/ > > > > I want to put all the titles of that blog page on my website. > > Is there an easy way to do this? > > > Because they're

Re: [PHP-DB] Google Style Search Results

2005-12-09 Thread Graham Cossey
On 12/9/05, Julien Bonastre <[EMAIL PROTECTED]> wrote: > Yay, Questionnaire time > > I love this part of the game > > > > a) I'm not very familiar with regex at all and was wondering if you could > tell me how your regex would handle two matched search strings that > exist within a few words of eac

Re: [PHP-DB] Google Style Search Results

2005-12-09 Thread Graham Cossey
On 12/9/05, Julien Bonastre <[EMAIL PROTECTED]> wrote: > http://aries.the-spectrum.org/webdev/wawd/forums/search.php?q=sufficient%2Blarge&st=post&sb%5B%5D=*&maxres=25&ob=datetime&ot=DESC > > > All I did was conjure up a regular expression that basically just matches > words :-) haha ironically..

Re: [PHP-DB] Re: SQL Insert INTO question

2005-12-08 Thread Graham Cossey
How about: $review = $_POST['review']; $sql = "SELECT * FROM reviews WHERE review_id = '$id'"; $res = mysql_query($sql) or die ("Query failed: " . mysql_error()); if (mysql_num_rows($res) > 0) { $sql_upd = "UPDATE reviews SET review_text = '$review'

Re: [PHP-DB] Suggestions please!

2005-11-22 Thread Graham Cossey
On 11/21/05, Micah Stevens <[EMAIL PROTECTED]> wrote: > Sounds like a decision needs to be made. If statements were born for that. > On Monday 21 November 2005 3:41 am, JeRRy wrote: > > Hi, > > > > Okay I have a dj site, I have alogin script and cookies to handle the > > login. > > > > Next I w

Re: [PHP-DB] Pagination

2004-12-16 Thread Graham Cossey
Try heading over to www.phpfreaks.com, they have a couple of tutorials/examples on how to achieve this. HTH Graham. On Thu, 16 Dec 2004 14:38:29 -0800, David Ziggy Lubowa <[EMAIL PROTECTED]> wrote: > > > Hey guys, > > I am working on an internal db and i have a script[below] which does some

Re: [PHP-DB] 5 hours later - sql error.

2004-12-03 Thread Graham Cossey
One observation: > print_r($query_rsCS); > if(!empty($aWHERE)); ^ Remove semi-colon ? > $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE); > print_r($aWHERE); HTH Graham -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.

RE: [PHP-DB] error:attempt to write a readonly database

2004-10-28 Thread Graham Cossey
[snip] > hi > i am getting the following error when i try to run my > php program..i want to know wht is this error in > general > > Warning: sqlite_query(): attempt to write a readonly > database in /home/saravall/.HTML/inv.php on line 26 > error:attempt to write a readonly database > [snip]

RE: [PHP-DB] Implementing search in a database driven website

2004-10-27 Thread Graham Cossey
I found this PDF 'quick reference' quite useful as I am just starting to learn how to use regular expressions. http://www.erudil.com/pdf/preqr.pdf HTH Graham > -Original Message- > From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] > Sent: 27 October 2004 04:11 > To: [EMAIL PROTECTED] > S

RE: [PHP-DB] Logging Into A MySQL (Web) Database

2004-10-22 Thread Graham Cossey
Probably an off-list posting. That's the problem of just using 'Reply' instead of 'Reply to All' on this list. Other lists I subscribe to always only ever have the list email address when replying, which in my opinion is a better way of doing things. [snip] > > Ok, who is Alex? > > If you are fol

RE: [PHP-DB] how many databases should I create

2004-10-18 Thread Graham Cossey
Just to add my 2p/2c.. I use multiple databases as I find this better suits my needs. It is easier to 'plug-in' various components to a client's application if each component is contained in an individual database. For example if your application was to be offered to clients as modules, then drop

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Graham Cossey
ein [mailto:[EMAIL PROTECTED] > Sent: 17 October 2004 16:14 > To: Stuart Felenstein; Graham Cossey; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Question: Putting separate form elements into an > array > > > Changed my direction somewhat but keep getting a parse > error and althoug

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Graham Cossey
Stuart, what does your echo($query) line output? I would hazard a guess that your quotes are wrong and you are not getting what you expect. What is &LUID? I believe you will need to execute an INSERT query within each "for($i=0; $i > This is how I am trying to get them into the database: > > $qu

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-16 Thread Graham Cossey
> > > Have you tried naming your form elements such as > > skill[], sky[] and slu[] ? > > (You could also use skill[1], skill[2], skill[3] > > etc... within your form.) > > Yes that makes sense. Good. This of course means you can build your form within a for loop (or similar). So to place 10 skil

RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-16 Thread Graham Cossey
Have you tried naming your form elements such as skill[], sky[] and slu[] ? (You could also use skill[1], skill[2], skill[3] etc... within your form.) This would pass the form values as arrays which you can then iterate through in your script. $skills = $_POST['skill']; $skys = $_POST['sky']; $sl

RE: [PHP-DB] Transactions - working but unsure about steps

2004-10-16 Thread Graham Cossey
Stuart, you are calling your rollback function only if $result is false. This check you are performing at the end of performing your 3 queries, each of which update $result. The net result here is that you will only call rollback() if the 3rd query results in false. I would create another functio

RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey
> > Stuart > --- [EMAIL PROTECTED] wrote: > > > If any of the variables used to insert data are > > strings ($f1a, $f2a, > > etc...), you'll need to have quotes around them. > > > > dave > > > > > > > > > > > > >

RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey
Stuart, you need to define $link if you're going to use it ;) > > Not much luck here on placing the mysql_error($link); > I know the server and database is reachable. So I > imagine the error is happening in the query. I've > moved the $link around with no luck. > > Stuart > > Revised code below:

RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey
A few ideas... [snip] > Anyway I get this message : "mysql_error(Resource id > #2)" > [snip] > @mysql_connect("myserver","myusername", "mypassword") > or die(mysql_error()); > > @mysql_select_db("mydatabase") or die(mysql_error()); > $link = mysql_connect("myserver", "myusername", > "mypassword");

RE: [PHP-DB] DB will INSERT wont UPDATE..error in code?

2004-10-12 Thread Graham Cossey
I'm no 'expert' (opening myself up for much criticism here) but try the following: (I'm assuming you are setting $fid somewhere) if (empty($form_status)) { $staff = $_POST["staff"]; $ttlpst = $_POST["ttlpst"]; $mnthpst = $_POST["mnthpst"]; $ttlicon = $_POST["ttlicon"]; $mnth

RE: [PHP-DB] accessing two databases within one script

2004-10-05 Thread Graham Cossey
I have several databases running on the same MySQL server and one application needs to run queries over two DBs at the same time. All I do is specify one connect (to the primary DB) and then specify the secondary DB within my queries. This seems to work fine, but not sure if it's discouraged for a

RE: [PHP-DB] Dynamic pull down menus with PHP/Mysql

2004-10-05 Thread Graham Cossey
Remember that PHP is server-side, so if you want PHP to do anything you'll have to send a request back to the server (reload the page). To handle things client side will require the likes of javascript, exactly how is beyond me I'm afraid but I'm sure you could do something like load all values i