Re: [PHP-DB] Given only one mySQL user account by Host Company

2005-01-23 Thread Stuart Felenstein
--- Doug Thompson <[EMAIL PROTECTED]> wrote: > > Shay wrote: > > Yes they gave me phpMyAdmin to use, and no, I have > no access to the > > user/privilege table. So the only way to output > database entries is to > > connect with the single super account they gave > me. > > > I find this unus

[PHP-DB] values getting blown away

2005-01-15 Thread Stuart Felenstein
I have a page set up with a sql query that receives $_POST values (from pervious page) to perpare records for update. Two of the values are via $HTTP_POST_VARS, 1 is via $_SESSION. Goes something like this: // begin Recordset $colname__rsLPINDS = '-1'; if (isset($HTTP_POST_VARS['PN'])) { $colnam

Re: [PHP-DB] Update multiple records

2005-01-11 Thread Stuart Felenstein
--- Jochem Maas <[EMAIL PROTECTED]> wrote: > > if (count($inds) > 0 AND is_array($inds)) { > > $ind = "'".implode("','", $inds)."'"; > > } > > looks like you want to do a select statement with > $ind in the form of > "SELECT * FROM yourtable WHERE yourfield IN ($inds)" > Adding the IN cla

Re: [PHP-DB] Update multiple records

2005-01-10 Thread Stuart Felenstein
--- Jochem Maas <[EMAIL PROTECTED]> wrote: > don't be sorry, be pro-active and rewrite it until > its idiot proof. its > in your own best interest - the clearer you state > your problem the > greater the chance someone will/can help you. > Well I've started with a clean slate. Meaning I ditc

[PHP-DB] Update multiple records

2005-01-10 Thread Stuart Felenstein
Having a problem here with updating multiple records in a table. First the table is like such: +-+--+ | RecordID [int] | IndID [int] | +-+--+ There is no auto inc column. User has a record number and then can have multiple rows in tabl

Re: [PHP-DB] Update / Delete / Insert quandry

2005-01-06 Thread Stuart Felenstein
--- Andrew Kreps <[EMAIL PROTECTED]> wrote: > On Thu, 6 Jan 2005 07:28:32 -0800 (PST), Stuart > Felenstein > <[EMAIL PROTECTED]> wrote: > > > > The problem I'm having a hard time getting my > hands > > around are those areas where they can have >

[PHP-DB] Update / Delete / Insert quandry

2005-01-06 Thread Stuart Felenstein
I am working on "update" areas for my end users. This is where they can go in and update and / or edit information in their profile. The problem I'm having a hard time getting my hands around are those areas where they can have multiple entries. One of the tables allows for a user to enter up

Re: [PHP-DB] stumped by "order by"

2004-12-19 Thread Stuart Felenstein
--- Jochem Maas <[EMAIL PROTECTED]> wrote: > > The problem is when I click the column sorter > link and > > the page re-loads, it looks like the where array > is > > getting wiped out, values are gone. I get a > "divison > > by zero" error. I'm assuming this is becasue the > > is this erro

RE: [PHP-DB] stumped by "order by"

2004-12-19 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > Hi Stu > > something like > > Bif(!empty($s_Ind)) $aWHERE[] = "Jobs.Industry IN > ($s_Ind)" ; > if(!empty($s_State)) $aWHERE[] = "Jobs.State IN > ($s_State)"; > if(!empty($s_TType)) $aWHERE[] = "Jobs.Term IN > ($s_TType)"; > if(!empty($JTitle)) $aW

[PHP-DB] stumped by "order by"

2004-12-19 Thread Stuart Felenstein
My problem is I can't seem to find the right place to put an "order by" clause in my statement. I have this select statement: $query_rsVJ = " SELECT Jobs.PostStart, Jobs.JobID,Jobs.JobTitle, Jobs.City, Ind.Categories, VendorSignUp.CompanyName, US.States, Term.Tax FROM Jobs INNER JOIN Ind ON

[PHP-DB] Dynamic where problem

2004-12-15 Thread Stuart Felenstein
I'm running a dynamic query and noticed I was not getting the results expected. Explanation: Here I make the declaration for the query array: $aWHERE = array(); Then test what variables came back from input: if(!empty($aWHERE)) { $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE); Here is the

Re: [PHP-DB] stumped-mail and database

2004-12-08 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > > --- Jason Wong <[EMAIL PROTECTED]> wrote: > > > > > Also just to be certain that you *are* running > those > > lines of code change the > > echo $to, to echo "Before $to" &

Re: [PHP-DB] stumped-mail and database

2004-12-07 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > > Also just to be certain that you *are* running those > lines of code change the > echo $to, to echo "Before $to" & echo "After $to" or > something. > Well now I feel like a damn jackass. I just discovered something that doesnt fix the issue, yet r

Re: [PHP-DB] stumped-mail and database

2004-12-07 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > What happens when you do this: > > $to = $rsVendorJobs->fields('Conmail'); > echo $to; > echo $rsVendorJobs->fields('Conmail'); > $to = $rsVendorJobs->fields('Conmail'); > echo $to; > Same thing: Call to a member function on a non-object in.. Stuart

Re: [PHP-DB] stumped-mail and database

2004-12-07 Thread Stuart Felenstein
--- Jochem Maas <[EMAIL PROTECTED]> wrote: > I just thought, if your query object ($) is > returning a > resultset object then maybe you have to 'loop' the > resultset object > in order to retrieve the 'row' object(s) from which > you can retrieve the > data. > Yes, but the recordset (or r

RE: [PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
--- "Norland, Martin" <[EMAIL PROTECTED]> wrote: > (Bear with me on this, because I've got nothing > remaining to go on...) > What do you get from: > > var_dump($query_rsVendorJobs); > var_dump($totalRows_rsVendorJobs); > var_dump($->SelectLimit($query_rsVendorJobs)); >

RE: [PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
--- "Norland, Martin" <[EMAIL PROTECTED]> wrote: > All I can recommend from here is heavy use of > printr() or var_dump() on > your variables. > They are NULL. That is the problem. I can't for the life of me , figure out a way to initialize these variables. > Obviously, also, you'll want to

RE: [PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
--- "Norland, Martin" <[EMAIL PROTECTED]> wrote: > What is $rsVendorJobs It's a "recordset" which for lack of a better definition is a sql query. > > Is $rsVendorJobs just the result of a mysql_query()? > If so, you probably > just want to be using: > > $to = $rsVendorJobs['Conmail']; Nope, t

RE: [PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
--- "Norland, Martin" <[EMAIL PROTECTED]> wrote: > 1) change > $to = "$rsVendorJobs->Fields('Conmail')"; > To > $to = "{$rsVendorJobs->Fields('Conmail')}"; > Or just > $to = $rsVendorJobs->Fields('Conmail'); > > 2) change > $body = '$cl'; > To > $body = $cl; > Well I'm sure

RE: [PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > I prefer to assign the db values to loca variables > to ensure that I am > sending out exactly what I need to. > Well the binding is one where clause that pulls the correct record for the transaction. Following what you are saying, how does that

[PHP-DB] stumped-mail and database

2004-12-06 Thread Stuart Felenstein
I'm trying to send mail out based partially on a recordset/binding. The fields are available but I'm not sure if they need to be turned into a variable first or if I can just reference them in the body of the email. Here is what I tried: $to = "$rsVendorJobs->Fields('Conmail')"; $subject = $rsVe

Re: [PHP-DB] Checkboxes on repeat regions

2004-12-06 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > I'm not sure what you mean exactly by "intended use > checkboxes". Intended use - I generate a list (via a repeat region) of records. Each item on the list has an associated checkbox. If I put a check in the box, do a $_POST I expect on the next page

Re: [PHP-DB] Checkboxes on repeat regions

2004-12-06 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > I understand from your previous postings that you > use Dreamweaver (to do at > least part of your coding). If you are at all > serious about coding with PHP > (ie you want to do stuff that is any more advanced > than the most basic stuff) > then you

[PHP-DB] Checkboxes on repeat regions

2004-12-05 Thread Stuart Felenstein
I have this form that is set up like this: Repeat Region 1 [From mysql recordset] +---+---+---+ | HTML checkbox | Profile Name | Edit Button | +---+---+---+ So if the user went to this page it would show a list of their pr

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > And, by the way, why on earth are you using a > print_r an a straight literal > string? Seems to me you could just put that text in > as part of the HTML: > >if ($row_rsCS == false) { >?> > No Matches > Found > exit; >} >

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > Well, your taste seems to be to use { }, so :-endif > is irrelevant. > Alright it's Friday, I'm punchy but we're all in a good mood ! Yes, I like the closing curlies So, then where do these lovely ladies go here ? if ($row_rsCS == false) { exit;

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > The reason the close is there is because the next > line > of code is the print_r , and I put some html in > there. > So this works great: if ($row_rsCS == false) { print_r ("No Matches Found"); exit; } But b

RE: [PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
> The closing ?> of a PHP segment also implies an > end-of-statement semicolon > -- so the above is equivalent to: > >if ($row_rsCS == false) ; >?> > > Which, of course, means that the scope of the if > doesn't extend to anything > beyond this point. > > You need to mark the block contro

[PHP-DB] Question: For no results

2004-12-03 Thread Stuart Felenstein
I want to send back a message when no matches are found on my search page. Basically "No matches found". I assumed that mysql_fetch_assoc would be the determining factor on whether any rows will come back. As you can see below I do a if ($row_rsCS == false). Apparently though (while the message

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

2004-12-03 Thread Stuart Felenstein
John! Your the man! It works! if (!empty(var)) Excellent. I think this is a good lesson in isset. I assumed they were the same. I guess reading the manual more would help. Thank you. Stuart > --- John Holmes <[EMAIL PROTECTED]> wrote: > > > You need to check if $stateReloc2, etc are empty()

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

2004-12-03 Thread Stuart Felenstein
--- John Holmes <[EMAIL PROTECTED]> wrote: > You need to check if $stateReloc2, etc are empty() > instead of set. > If the variable is set, but empty, you're going to > end up with a > query like "Prof.State1 IN ()" which will cause your > error, which > we would have seen if you'd just posted th

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

2004-12-03 Thread Stuart Felenstein
--- John Holmes <[EMAIL PROTECTED]> wrote: > Stuart Felenstein wrote: > > if(isset($stateReloc2)) $aWHERE[] = "Prof.State1 > IN > > ($stateReloc2)"; > > You need to check if $stateReloc2, etc are empty() > instead of set. > If the variable is s

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

2004-12-03 Thread Stuart Felenstein
--- Graham Cossey <[EMAIL PROTECTED]> wrote: > One observation: > > > print_r($query_rsCS); > > if(!empty($aWHERE)); > ^ Remove > semi-colon ? > > > $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE); > > print_r($aWHERE); > > HTH > > Graham > Didn't do it. :

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

2004-12-03 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > > can you post the code that creates the sql > statement > > bastien > I'm posting the entire script. I hope it comes through legible. If not I can do an attachment so the format, line breaks will remain. 0 AND is_array($taxType)) { $s_

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

2004-12-03 Thread Stuart Felenstein
--- John Holmes <[EMAIL PROTECTED]> wrote: > Stuart Felenstein wrote: > Print out the entire query before you run it. Syntax > errors are usually > pretty obvious. If not, post the actual query here. I found one possible syntax error and fixed it though it seemed to ha

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

2004-12-02 Thread Stuart Felenstein
--- "Gryffyn, Trevor" <[EMAIL PROTECTED]> wrote: > Looks like your $expLevl value is empty. It's > probably set, but has no > value in it. Check that. > No sorry to say that isn't it. It seems that for every field i submit in the search, it's the field right after where the syntax error is re

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

2004-12-02 Thread Stuart Felenstein
I'm running into a syntax error: 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 ') AND Prof.WorkExp IN () AND Prof_Industries. Now I printed out the query and that works as I dumped it into a mysql client and i

Re: [PHP-DB] Basic JOIN tutorial - RE: [PHP-DB] Job interview test - I give up...

2004-12-01 Thread Stuart Felenstein
--- "Gryffyn, Trevor" <[EMAIL PROTECTED]> wrote: > If you have Microsoft Access or something else that > graphically lets you > create queries, you might try building a query that > you know works and > returns what you need, then looking at the SQL VIEW > to see how the > syntax goes. It can he

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > so...best to build the statement dynamically and > execute it once only if the > input box has a value in it... > And that is the way I'm building it. Just thinking about the scenario that somone actually chooses 75% of the options - would that po

Re: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
Sorry ..hit the wrong button --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: I posted this over on mysql list. Not trying to be redundant, but would like to get some feedback. Basically I'm wondering. I am creating a search form , dynamic query, that could potentially have in

[PHP-DB] Question on the use of where statements

2004-12-01 Thread Stuart Felenstein
I posted this over on mysql list. Not trying to be redundant, but would like to get some feedback. Basically I'm wondering. I am creating a search form , dynamic query, that could potentially have in the area of 40+ where statements. i.3. 1- where x = y and -- PHP Database Mailing List (http:

RE: [PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
--- [EMAIL PROTECTED] wrote: > > --- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > Don't know about other database engines, but in > MySQL, it doesn't matter > if an int is inserted as a string, i.e., with the > quotes. My recollection > is that MySQL handles the type conversion > internally. So,

RE: [PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > > 0: INSERT INTO Table1 (LurkID, ProfileName, Edu, > > WorkAuth, WorkExp, CarLev, Secu, Confi, Relo, > > Telecomu, City1, State1, City2, State2, > TravelPref, > > SalaryAnnual, SalaryHourly, Available) VALUES (47, > > '', 7, 2, 1015, 5, , '',

Re: [PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: One last thing to add on this issue. This table was created using tabletype InnoDB. Now I discovered earlier that this table and (many others) had switched over to MyISAM. I'm still trying to trace down the cause with my ISP. Anyw

Re: [PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
--- denys <[EMAIL PROTECTED]> wrote: > hi! > what if you try to ignore the primary key in fields > and values list ? > MySQL should assign a valid primary key. It's what > I'm doing on 4.0.22 > and it's working If not, try to echo your query > and write it in > MySQL( GUI or console). >

Re: [PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > I know recently the server was update from PHP 4.3.8 > to 4.3.9 but that shouldn't have effected anything. > > Code: > > $query = "INSERT INTO table1 (ProfileID, LurkID, > ProfileName, Ed

[PHP-DB] Transaction suddenly not working

2004-11-29 Thread Stuart Felenstein
I know recently the server was update from PHP 4.3.8 to 4.3.9 but that shouldn't have effected anything. Code: $query = "INSERT INTO table1 (ProfileID, LurkID, ProfileName, Edu,..." VALUES (null,..." ProfileID is the PrimaryID (autoinc) - I've set the input v

RE: [PHP-DB] Updating count on record results

2004-11-19 Thread Stuart Felenstein
--- Bastien Koert <[EMAIL PROTECTED]> wrote: > this is how I did it for a client's site > > // update the number of times the vehicle has been > viewed > mysql_db_query($dbname, "UPDATE vehicle_inventory > SET viewed=viewed+1 WHERE > ccode='$ccode'", $link); > Where did this code go though ? M

[PHP-DB] Updating count on record results

2004-11-19 Thread Stuart Felenstein
I am setting up a table to log a count on individual records for every time they are returned in a results return. Just so to illustrate Record1 First search brings up Record1 (counter is set too 1) Second search brings up Record1 (counter is set too 2) Third search brings up Record1 (counter

[PHP-DB] [SOLVED]Re: [PHP-DB] Search results page not working with table joins

2004-10-25 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > I have a search page and a results page. It's a > dynamic search. It works great with just the main > table, but as soon as I add in the table joins (to > translate the codes) it just dumps out all the > record

[PHP-DB] Search results page not working with table joins

2004-10-25 Thread Stuart Felenstein
I have a search page and a results page. It's a dynamic search. It works great with just the main table, but as soon as I add in the table joins (to translate the codes) it just dumps out all the records regardless of criteria. Here is the script without the joins: http://www.w3.org/TR/html4/lo

[PHP-DB] Question: Copy and paste text into mysql text column

2004-10-19 Thread Stuart Felenstein
I have a textarea field that will allow users to copy and paste text into , it might be plain text, or it might come out of word. I'm wondering what type of validations I should perform on this field ? Any suggestions / ideas ? Thank you, Stuart -- PHP Database Mailing List (http://www.php.net

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

2004-10-17 Thread Stuart Felenstein
; the same script(s) on 2 lists. > > What is the current situation? Iterating through the > 3 arrays or inserting > into MySQL? > > Graham > > > -Original Message- > > From: Stuart Felenstein > [mailto:[EMAIL PROTECTED] > > Sent: 17 October 2004 16:14

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

2004-10-17 Thread Stuart Felenstein
Changed my direction somewhat but keep getting a parse error and although I know where it is , I can't seem to figure out what I need to do to make it syntax correct: This is how I am passing the arrays: if ( empty( $_SESSION['l_skill'] ) ) { $_SESSION['l_skill']=array(); } if ( is_array( $_REQU

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

2004-10-17 Thread Stuart Felenstein
Not exactly sure what I did here. there are 5 skill textfields name skill[] then the years sky[] then the last used slu[] I was following the format of my other arrays, so stored them list this: if ( empty( $_SESSION['l_skill'] ) ) { $_SESSION['l_skill']=array(); } if ( is_array( $_REQUEST['sk

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

2004-10-16 Thread Stuart Felenstein
See interspersed: --- Graham Cossey <[EMAIL PROTECTED]> wrote: > 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. > You can just as easily store the arrays in your

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

2004-10-16 Thread Stuart Felenstein
Right now this seems something like solving a rubic's cube. While I process, I hope it's alright that i'm asking here. I think my quantity of posts have been high :) I have these form elements:(these are the names of the elements) skill1sky1 slu1 skill2sky2 slu2 skill3sky

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

2004-10-16 Thread Stuart Felenstein
> { > commit(); > echo "your insertions were successful"; > }else{ > echo mysql_errno($link)." : > ".mysql_error($link)."\n"; > rollback(); > exit; > } > > Graham > > > > -Original Message- > > From: Stuart

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

2004-10-16 Thread Stuart Felenstein
See Interspersed: --- Martín Marqués <[EMAIL PROTECTED]> wrote: > I was tryiong to generate a validation that would > fail with certain inserts > (or modification of a register). Using more then 25 > characters in the second > field would yield the same result. Got that and yes, for my pages ,

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

2004-10-16 Thread Stuart Felenstein
I think you are adding a conditonal /validaton statement as the constraint ? More then x characters will generate an error. My understaning is an error in mysql transaction will rollback should rollback the entire set of transactions. error handling for each statement- values will be coming from

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

2004-10-16 Thread Stuart Felenstein
My statements are all working but I'm not sure if things are set up correctly. I say this because at one point the first $query failed, yet the rest of inserts wre committed. Now I believe I need to set autocommit to 0 , yet the query failed due to a syntax error. Hence 0 records effected wouldn'

Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Stuart Felenstein
You also > need to have the database function to insert into > the database. > Assuming it MySQL: > ... > foreach(...) { > $query = "INSERT INTO ..."; > mysql_query($query); > } > > On Oct 15, 2004, at 4:40 PM, Stuart Felenstein > wrot

Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Stuart Felenstein
Actually it did just loop. I need to test again. The insert statement is the the one $query = So it's after yes, but contained in the braces, like you diagram below. Stuart --- "Matt M." <[EMAIL PROTECTED]> wrote: > where is your insert statement? I am guessing it is > after your loop > >

Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Stuart Felenstein
Yep, I had found it shortly before. Only it's not looping. It is taking last value only. Stuart --- "Matt M." <[EMAIL PROTECTED]> wrote: > if ( is_array( $_SESSION['l_industry'] ) ) { > foreach ( $_SESSION['l_industry'] as $p ) { > $query = "INSERT INTO Profiles_Industries

Re: [PHP-DB] Array and insert statement throws error

2004-10-15 Thread Stuart Felenstein
Where would that go? Stuart --- "Matt M." <[EMAIL PROTECTED]> wrote: > > if ( is_array( $_SESSION['l_industry'] ) ) { > > foreach ( $_SESSION['l_industry'] as $p ) > { > > $query = "INSERT INTO Profiles_Industries > (ProfileID, > > IndID) > > VALUES ($LID, $p)"; > > } > > do you have a

[PHP-DB] Array and insert statement throws error

2004-10-15 Thread Stuart Felenstein
Trying to get array of values into table. Each value will be part of a new record, so it's a loop. I am getting a parse error though and for further down in the code though I know this is what's causing it. Is there anything wrong with this statement ? if ( is_array( $_SESSION['l_industry'] ) )

Re: [PHP-DB] Help: Transactions working but question / issue

2004-10-15 Thread Stuart Felenstein
Here is my situation , not sure how I should handle it. I have this multi page form, at the end I use mysql transaction to get the data into all the tables. All the tables are innodb with the exception of one. The last page has one field which takes a copy/paste of a document, so it's a text area

Re: [PHP-DB] Help: Transactions not working

2004-10-15 Thread Stuart Felenstein
John, Big thank you! for your help. I had been trying out the mysql_insert_id and was not having luck. It's working great (with just a few more bumps to get over). --- John Holmes <[EMAIL PROTECTED]> wrote: > Stuart Felenstein wrote: > > > But - I want to co

Re: [PHP-DB] Help: Transactions not working

2004-10-15 Thread Stuart Felenstein
That made a world of difference! :) Thank you. But - I want to confirm, am I still using transactions even though I'm issuing individual query calls for each insert. And, if I can ask another question to the list : In this line (from the second insert) VALUES (null, LAST_INSERT_ID(), ..)";

[PHP-DB] Help: Transactions not working

2004-10-15 Thread Stuart Felenstein
If you see the code I have the begin , then the $query follows. With both statements present, only the second one does the insert. If I // or remove the second, the first one takes. Am I missing something here ? Stuart Code: function begin() { mysql_query("BEGIN"); } function commit() { mysq

Re: [PHP-DB] Converting Date for mysql

2004-10-15 Thread Stuart Felenstein
Yes, my apologies to the list! Stuart --- David Robley <[EMAIL PROTECTED]> wrote: > May I suggest that as well as echoing mysql_error() > you also echo your > query; that way you can see _exactly_ what is being > passed to mysql and you > can resolve problems like this simply and without > resor

Re: [PHP-DB] Converting Date for mysql

2004-10-15 Thread Stuart Felenstein
See below: --- John Holmes <[EMAIL PROTECTED]> wrote: > Are you sure it's the date that's causing the > rejection? What does > mysql_error() say? No, I'm not sure. At first the date was being accepted but "wrong" in the database. It was setting it to 1/1/2000. Someone suggested I add '' aroun

[PHP-DB] Converting Date for mysql

2004-10-14 Thread Stuart Felenstein
I have one of those widget calendars. Mysql keeps throwing back the date regardless of the way I format it. I'm passing session variables over to the database and have tried quotes ' around the date as well. Now I went ahead and changed this line: $_SESSION['f3k'] = $_POST['DateAvailable'];

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

2004-10-14 Thread Stuart Felenstein
t; integers, right? So put single > quotes around the whole date, like '10/15/2004'. > > dave > > > > > > Stuart Felenstein <[EMAIL PROTECTED]> > > 10/14/2004 10:02 AM > > > > > > To: > Stuart Felenstein <[EM

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

2004-10-14 Thread Stuart Felenstein
s //needed though it doesn't make a diff begin(); // transaction begins $result = mysql_query($query); --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2004-10-14 Thread Stuart Felenstein
Quote as in "string" or quote as in 'string' ? Those two confuse me. 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 Stuart Felenstein
Well believe it or not I got it right finally. Just used the example from the manual. Meanwhile, the funny thing is , I think the error translates back to my original error abut Resource ID#2 Because not I get : Check the manual that corresponds to your MySQL server version for the right syntax t

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

2004-10-14 Thread Stuart Felenstein
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: --- Graham Cossey <[EMAIL PROTECTED]> wrote: -- PHP Database Mailing Lis

[PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
First time setting something like this up. So probably making some major mistakes. Anyway I get this message : "mysql_error(Resource id #2)" I know it's pointing me to something but not sure what . My suspicion since I'm driving blind :) is that I'm attempting an insert using invalid or incorrect

RE: [PHP-DB] Transactions ....[was]: MySQL, Multiple tables............

2004-10-14 Thread Stuart Felenstein
quot;; > $sql .="insert into table 1..."; > $sql .="insert into table 2..."; > $sql .="insert into table N..."; > $sql .="end"; > > $result = mysql_query($sql); > > hth > > > >From: Stuart Felenstein <[EMAIL PROTECTE

[PHP-DB] MySQL, Multiple tables, and Multipage form using sessions

2004-10-13 Thread Stuart Felenstein
Can anyone, someone please point me in the right direction. I have a multi page form, so at the last page I want to insert all data into database. Basically I'm trying to go from 0 - 90 , meaning my skills are less the basic. And this seems like a big task. Couple of other things. 1-There would ne

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
iables, $l_industry['0'], > $l_industry['1']... ? > > dave > > > > > > > > > Stuart Felenstein <[EMAIL PROTECTED]> > > 10/11/2004 10:20 AM > > > > > > To: > [EMAIL PROTECTED] > cc: > >

[PHP-DB] Suggestions for record insertion

2004-10-11 Thread Stuart Felenstein
I've put together a long form that spans 5 tables of the database. Once the user has reached the final page I want to insert into database but wonder what the logical steps would be. I'll be reading through manual , but thought I'd ask about things like "rollback". I'm guessing that for whatever

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I may have spoken too soon. Having one minor problem with getting an array (from a multiple select) to print out. Anyone see anything wrong here : Here is registering session array: if ( empty( $_SESSION['l_industry'] ) ) { $_SESSION['l_industry']=array(); } if ( is_array( $_REQUEST['LurkerInd

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
Jason, thank you for all the help today! It's all working now. However, warning: I maybe back when I try to slam it all into the database. Stuart --- Jason Wong <[EMAIL PROTECTED]> wrote: > On Monday 11 October 2004 19:42, Stuart Felenstein > wrote: > > I think I fou

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I think I found the correct way. By registering the session variable in the "next" page is how they take. Form Page 1 - collect user input Form Page 2 - $_SESSION['name'] = $POST['myane']; This sound right? Stuart --- Stuart Felenstein <[EMAIL PROTECTED]>

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > The point is that you should understand *what* is > going on with the examples. > It's only when you've understood something that you > can then apply it to > other situations. Your right and I agree with you. My perspective is that the example(s)

Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > If you don't have a specific reason for this to be > enabled you should disable > it. I don't control it. On a shared server. > > Question 1: is this enough to register the session > > variable ? > > No. You should read (repeatedly if necessary) >

[PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I can't seem to figure this out. Right now I'm still trying to get the multi page form down. For the facts, running php 4.3.8, apache 1.3.x Register Globals are enabled So I'm starting the pages with: Now since this is a form, the user creates the value for the variable, so within the form: Q

[PHP-DB] Form values

2004-10-09 Thread Stuart Felenstein
to pass session values, with a textbox I'm doing like this: what I can't find out about is if I have a select menu with a dynamic table feeding it: State 1 EOF){ ?> Fields('States')?> MoveNext(); } $rsStates->MoveFirst(); ?> So the php is

Re: [PHP-DB] Help: Arrays with Session Variables not happening

2004-10-08 Thread Stuart Felenstein
K ..my problem seems to be combining echo on the menu values with the print array. If I echo $array[0]; that seems to work fine !? Stuart --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > Back again , sorry :) > > I had my form set up with 7 multi selects , on the >

[PHP-DB] Help: Arrays with Session Variables not happening

2004-10-08 Thread Stuart Felenstein
Back again , sorry :) I had my form set up with 7 multi selects , on the return page, all 7 arrays were returned correctly. Now that I've changed back 5 to regular menu selects (1 selection), the 2 arrays left won't return the values. The menus work fine. Here is my code: Page 1: Page 2

RE: [PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Stuart Felenstein
Figured it out. Page 2 had to have the field name in the $SESSION parameters, not the holder from the Page1 array register. Stuart --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > Well I guess too much success at once is a bad > thing. > > For some unapparent reason,

RE: [PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Stuart Felenstein
Well I guess too much success at once is a bad thing. For some unapparent reason, the variables here are not carrying over. Anyone see anything wrong here ? Page1 (Somewhat snipped) Page 2: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> Untitled Document Your cart:\n"; f

RE: [PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Stuart Felenstein
> http://www.planetthoughtful.org > Building a thoughtful planet, > One quirky comment at a time. > > > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: Saturday, 9 October 2004 1:57 AM > To: Bastien Koert; [EMAIL PROTECTED] > Subject: RE:

RE: [PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Stuart Felenstein
See interspersed: --- Bastien Koert <[EMAIL PROTECTED]> wrote: > Hi Stu > > 1. why not check it on every page, then if it fails > the user won't need to > make it to the end and then have to go back to the > beginning to fix > something minor. > > 2. You could use hidden fields to pass the dat

[PHP-DB] Help: First Time Form with Sessions

2004-10-08 Thread Stuart Felenstein
Okay , so I'm working on the multi page form. Insert into DB will come at the last page. Couple of things I want to confirm: 1-Each page should have validiation for each field. Probably doesn't make any sense to wait for last page ? or maybe ? Below is the first page of the form: I only have

[PHP-DB] Obfuscator

2004-10-07 Thread Stuart Felenstein
I have been planning, when the time is right (site is ready for real time) , to add obfuscation to pages. Wondering what others are doing in this area. Is this a typical thing that better sites use ? I see some commercial PHP obfuscators out there, anyone have recommendations ? Thank you , Stuar

Re: [PHP-DB] Re: Session confusion

2004-10-06 Thread Stuart Felenstein
> session and to access the session variables. > > Here is a link of a tutorial about using sessions: > http://www.phpfreaks.com/tutorials/41/3.php Look > for the word MUST in red > and read that paragraph. It should tell you what > you need to know. > > Hope th

[PHP-DB] Session confusion

2004-10-06 Thread Stuart Felenstein
Back to my multi page form again ;) I am going to try it with Session variables . So, one thing is confusing me. The page requires the user to be logged in and is being tracked via authentication. Do I still need to do a "session_start();", at the beginning of the form process ? Stuart -- PHP

  1   2   >