[PHP-DB] MySQL: did anyone start a transaction?

2009-05-08 Thread Bogdan Stancescu
Hello all, I asked this question on php-general last month (http://marc.info/?t=12404923034r=1w=2), and received some answers -- but I was directed to this list, so here. My question is: can I tell programatically whether the next query I'm going to execute is already part of a transaction,

[PHP-DB] Re: Adding a log file

2003-11-05 Thread Bogdan Stancescu
$Addcart() -- is Addcart() a function (in which case you should remove the dollar sign) or are you specifically trying to do some magic there by running a function whose name is stored in that variable? Bogdan Robert Sossomon wrote: I am seeing some errors with a program I wrote and I need to

Re: [PHP-DB] PHP Newbee Question

2002-07-02 Thread Bogdan Stancescu
Variable names are case-sensitive in PHP - try $HTTP_POST_VARS[first] - or, for new versions of PHP, $_POST[first]. In another train of thoughts, please use the proper e-mail address - I'm sure I'm not the only one using filters to automatically move mail to folders and your although probably

Re: [PHP-DB] Column headers

2002-07-02 Thread Bogdan Stancescu
For MySQL, see mysql_num_fields() and mysql_fetch_field() at http://www.php.net HTH Bogdan Casey Allen Shobe wrote: How can I get the column headers from a query? For example, on a 'select blah, blah2, blah3, something as blah4 from whereever', I would want the blah, blah2, blah3, blah4,

Re: [PHP-DB] PHP Newbee Question

2002-07-02 Thread Bogdan Stancescu
. Unfortunately it didn't fix the issue. I am sorry about the way the address message is displayed. There unfortunately isn't anything I can do about it. Jeffrey Norsworthy MCP, CCNA Network Administrator Community Health Services [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Bogdan Stancescu [EMAIL

Re: [PHP-DB] fopen() question

2002-06-06 Thread Bogdan Stancescu
Also, if you check many URL's from the same script, make sure neither PHP nor the browser times out. For PHP, set_time_limit() and for the browser echo a space and flush() after each test. Bogdan Bogdan Stancescu wrote: Try $fp=@fopen( etc Bogdan Tony wrote: I have a database and I am

Re: [PHP-DB] sql and week starting ending numbers (dates)

2002-06-01 Thread Bogdan Stancescu
SELECT FROM_DAYS(TO_DAYS(purchaseDate)-DAYOFYEAR(purchaseDate)+WEEK(purchaseDate)*7) will hopefully return the date you need. You'll have to enclose all that in a DATE_FORMAT to get a printable date tho. Last minute note: you might have to subtract 1 from the last term because I guess MySQL

Re: [PHP-DB] returning all rows

2002-05-20 Thread Bogdan Stancescu
Just lose the WHERE city=\$city\ in the SQL. Bogdan Todd Williamsen wrote: I know I have asked this silly question before, but forgive me since I have been a bit rusty with PHP lately So how do I return all rows? I have this: $sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ;

Re: [PHP-DB] returning all rows

2002-05-20 Thread Bogdan Stancescu
. But it only returns one row Bogdan Stancescu [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Just lose the WHERE city=\$city\ in the SQL. Bogdan Todd Williamsen wrote: I know I have asked this silly question before, but forgive me since I have been a b

Re: [PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread Bogdan Stancescu
Well, the first question is what's the expected output? If you're trying to get, say, title from table1 and rating from table2 and identify the books in table1 by the unique field id and in table2 by the field book_id, then this is what you should have to end up with: SELECT t1.title,

Re: [PHP-DB] variable interpolation in mysql queries

2002-02-26 Thread Bogdan Stancescu
$query=query; $result=mysql_query($query); $pd=mysql_result($result); Notice the zig-zag - $query is first on the left side, then on the right side, then $result is first on the left side, then on the right side. Bogdan Ryan Snow wrote: Hi, Im kinda new to this list. Can anyone tell me what

Re: [PHP-DB] variable interpolation in mysql queries

2002-02-26 Thread Bogdan Stancescu
PS. You should consider using mysql_fetch_row() or at least mysql_fetch_array() for perforance reasons. B Bogdan Stancescu wrote: $query=query; $result=mysql_query($query); $pd=mysql_result($result); Notice the zig-zag - $query is first on the left side, then on the right side

Re: [PHP-DB] Using checkbox in php problem

2002-02-23 Thread Bogdan Stancescu
This is only part of the solution, but you should be aware that == is a comparison operator whereas = is the assignment operator. Bogdan Killer Angel Clark wrote: I add a checkbox in my page and will use the check result on another page. If it is checked, it has no problem. However, if it is

Re: [PHP-DB] DB question

2002-02-23 Thread Bogdan Stancescu
No, at 1000+ you shouldn't have problems, almost no matter what database/data you're using. You may start getting slowdowns at 100,000+ users if you have a lot of data and probably 500,000+ if you have the reasonable data usually required. Anyway, using a different database for each user

Re: [PHP-DB] Instest of add, subtract.

2002-02-23 Thread Bogdan Stancescu
Well, there are quite some differences difference between the results these two pieces of code yield. Let's see what your sql query would be for the first version, replacing $deposit in $query: UPDATE wt_users set bank_points + $user_depositset points - $user_deposit WHERE uid={$session[uid]}

Re: [PHP-DB] Performance Improvements

2002-02-23 Thread Bogdan Stancescu
My first suggestion: replace all split() calls with explode() calls. Bogdan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Performance Improvements

2002-02-23 Thread Bogdan Stancescu
not checked for variables. HTH Bogdan Bogdan Stancescu wrote: My first suggestion: replace all split() calls with explode() calls. Bogdan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Sample Warehouse Management System Codes?

2002-02-18 Thread Bogdan Stancescu
I'm constantly amazed how people can post such e-mails without first checking freshmeat - it really takes longer to write the e-mail, you know? This is what I came up with - out of sheer curiosity - in less than a minute, by clicking on freshmeat, typing warehouse and clicking on the project

Re: [PHP-DB] limit sytax error

2002-01-21 Thread Bogdan Stancescu
Quoting from the MySQL manual: In MySQL Version 3.23, you can use LIMIT # to ensure that only a given number of rows are changed. So then, it's LIMIT # instead of LIMIT #,# Obviously, the way around it would be using WHERE instead of LIMIT, but I don't know your table structure so I can't

Re: [PHP-DB] Automatic Listboxes

2002-01-15 Thread Bogdan Stancescu
You'll have to submit the data. Just that instead of pushing go, you can get JavaScript to do that. For instance, form name=myForm1 action=? echo $PHP_SELF? select name=country onChange=document.myForm1.submit() option value=Albania option value=Andorra /select /form form name=myForm2

Re: [PHP-DB] Re: Defining Arrays

2002-01-13 Thread Bogdan Stancescu
Why don't you try $denc[]=substr($text,$i,1); Not to mention that $text[1] already is h. Bogdan Thomas \omega\ Henning wrote: Something i forgot when i echo($denc[1]); then it types Array out !!! Thomas Omega Henning [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

Re: [PHP-DB] Sanitizing user input for interaction with DB.

2002-01-13 Thread Bogdan Stancescu
I've started a thread on the topic some time ago on the php list, after some extensive reading and testing and these were the main conclusions: 1.1. ALWAYS pass addslashed values and always pass them quoted in the SQL statement. That is insert into table1 set id='$id' even if $id is known to

Re: [PHP-DB] Probably an easy question - blank search fields (PHP MySQL)

2002-01-06 Thread Bogdan Stancescu
$result = mysql_query(select * from equipment where (category='$category') and (description like '%$description') and (roomloc='$roomloc') and (quantity like '%$quantity') and (serialno like '%$serialno') and (patdue like '%$patdue'),$db); Gary Smith wrote: Hiya, I'm writing a backend in

Re: [PHP-DB] help on mulit query

2002-01-06 Thread Bogdan Stancescu
You seem to be doing it fine as far as I can see, except for song_id which should be songs_id in the query... Bogdan Barry Rumsey wrote: Hi I have three tables set out below: xp_artist: artist_id , artist _name xp_sings: artist_id , songs_id xp_songs: songs_id , song_name , lyrics I

Re: [PHP-DB] help on mulit query

2002-01-06 Thread Bogdan Stancescu
Just echo a link of the form a href=\lyrics.php?song_id=$song_id\Click for lyrics/a and use the incoming song_id in lyrics.php to get it from the database. Bogdan Barry Rumsey wrote: I did not see that ( I must be blind hehe ). One other question , I have the lyrics also stored in the

Re: [PHP-DB] querystring text

2002-01-04 Thread Bogdan Stancescu
rawurlencode() does this trick. Matthew Tedder wrote: Quick question for anyone who knows, Is there a PHP function to make data safe for sending in the query string? $var = something or other; // TODO: What is function to translate $var for querystring compatibility? print a

Re: [PHP-DB] Please help asap

2002-01-04 Thread Bogdan Stancescu
In the printf() line after 5 6 7 you try to print %s 24 times but only provide 10 values. That may have something to do with it... Bogdan Jeff Moncrieff wrote: Hello I am trying make a script fatch my data form my mysql database. I use this script but when execute it is says Warning:

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Those are two different things. You never mentioned your HTML problem, that's why nobody adressed it. So, the proper way to do it is: 1. Insert into the database using addslashes(); 2. Use stripslashes() after retrieving the data if you need to; 3. Use htmlspecialchars() for displaying the data

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
-Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 1:41 PM To: Jonathan Hilgeman Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DB] Fixed Quote Marks in Inputs That would be because this way you'll end up with the proper data in the database

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Ok, seems like I misjudged you and I apologize for that. I haven't changed my opinion about the very issue we've been discussing - only wanted to post the sentence above, just for the record. Bogdan Jonathan Hilgeman wrote: Apparently, the experienced way is to store them with slashes, which

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Ok, finally found a valid argument! :-) What if the user enters I'm aware that 23!? Bogdan Jonathan Hilgeman wrote: And I apologize if I came off as ultra-defensive/rude. I had a bad day, a bright idea, and then felt like someone was tearing it to pieces. This is like the PHP soap opera.

Re: [PHP-DB] match

2002-01-04 Thread Bogdan Stancescu
Why would this be a problem (i.e. the fact that a user may insert pre in a form field)? If you're worried about security (i.e. users adding JavaScript code) you can always htmlspecialchars() the string... Bogdan louie miranda wrote: Hi is it possible to match a certain string when a user

Re: [PHP-DB] Fixed Quote Marks in Inputs

2002-01-04 Thread Bogdan Stancescu
Bogdan Stancescu wrote: Ok, finally found a valid argument! :-) What if the user enters I'm aware that 23!? Bogdan Tested it - it works. However, you'll have big problems if you'll ever need to echo the data. Consider this example: Enter description: input box The user enters Edited

Re: [PHP-DB] The file '/tmp/phpxw2cJS' must be in the database directory or be readable by all

2002-01-03 Thread Bogdan Stancescu
Do you have control over where the file to be loaded is located? If so, simply create a directory in your user's home, and do what the error message says :-) HTH Bogdan Hayan Al Mamoun wrote: I have this error when I try to execute Load Data Infile .. statement, although temp directory

Re: [PHP-DB] Multiple select list box to search mysql database

2002-01-01 Thread Bogdan Stancescu
In HTML: SELECT name=manufacturernames[] multiple (note the name has PHP-like array definition) In PHP: for ($i=0;$isizeOf($manufacturernames);$i++) { if ($i==0) { $q_cond=where; } else { $q_cond=or; } $query.=$q_cond MANUFACTURER LIKE '$manufacturernames[$i]'; } Gisele Grenier

Re: [PHP-DB] Multiple select list box to search mysql database

2002-01-01 Thread Bogdan Stancescu
Bogdan Stancescu wrote: In HTML: SELECT name=manufacturernames[] multiple (note the name has PHP-like array definition) In PHP: for ($i=0;$isizeOf($manufacturernames);$i++) { if ($i==0) { $q_cond=where; } else { $q_cond=or; } $query.=$q_cond MANUFACTURER LIKE

Re: [PHP-DB] odbc date

2001-12-30 Thread Bogdan Stancescu
If everything else fails, you can retrieve unix_timestamp(date) and use PHP's date() to format the output. HTH Bogdan George Nicolae wrote: for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field, php will automatically convert it to '/mm/dd hh:mm:ss' format regardless

Re: [PHP-DB] Iinserting into 250 tables filtered data automaticly. delaytime??

2001-12-29 Thread Bogdan Stancescu
You actually have a time-out problem on exec_stmt(), because the for() can't loop without executing all of the statements within. You may want to start looking for ways to increase the time php waits for mysql to execute a query. Just to make sure I'm not senselessly babbling here, what does

Re: [PHP-DB] Passing parameter in Paging

2001-12-28 Thread Bogdan Stancescu
I don't understand why you won't use forms with buttons and hidden controls since you know about this solution. I have two suggestions along this line: 1. You probably don't want buttons on the page -- you may use image icons instead (similar to a tape recorder's play and fast forward for next

Re: [PHP-DB] Weigting a random selection

2001-12-28 Thread Bogdan Stancescu
Yup, that's the roulette selection, as they call it. It's pretty simple, actually. The idea is that you use a concept similar to a roulette table, just that the sectors aren't equal -- they're equal to their respective weights. The procedure is as follows: 1. Assign the weighting to each of the

Re: [PHP-DB] expiration date help

2001-12-26 Thread Bogdan Stancescu
Jason Dulberg wrote: I need to stick a little expiration date into a part of my site but can't seem to get it going properly. Your logic is ok -- DATE_ADD() is the function to work with. You don't give any details about the actual problem you're having, but from the e-mail it seems you're

Re: [PHP-DB] Selecting last row

2001-12-21 Thread Bogdan Stancescu
select * order by id desc limit 1; (obviously, id must be the field you yourself order the table by in your mind when you say last row) Necro wrote: What query can I use to select the last row in a table?? Andrew -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail:

Re: [PHP-DB] mysql table layout help needed

2001-12-20 Thread Bogdan Stancescu
A sample of what you were trying would have been helpful... If I understood your problem right, the solution is a piece of code like this: ? echo(table\ntr\n); while ($myrow=mysql_fetch_row($result)) { $colcount++; if ($colcount==$desiredcolcount) { $colcount=0; }