Re: [PHP-DB] Unicode error with PostgreSQL

2006-09-26 Thread Niel Archer
Hi Tony You can use the multibyte aware string functions for processing. There is also a way to make it use UTF-8 encoding, but I forget how just now. I had the same problem with a MySQL db a while back. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP-DB] moving a selection of records from one table to another (identical in structure) table?

2006-09-27 Thread Niel Archer
Hi Easiest way would be to have MySQL to do it, using an INSERT ... SELECT statement Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] moving a selection of records from one table to another (identical in structure) table?

2006-09-27 Thread Niel Archer
Hi > Easiest way would be to have MySQL to do it, using an INSERT ... SELECT > statement ... and if you're moving (not just copying) deleting the selected records after of course. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: moving a selection of records from one table to another (identical in structure) table?

2006-09-27 Thread Niel Archer
Hi > Would you happen to have a nice little example-script for me/us? :-) yup, here's a little example: $condition = "WHERE username LIKE 'm%'" if (mysql_query("INSERT AuthCopy SELECT * FROM Auth $condition")) mysql_query("DELETE FROM Auth $condition"); This assumes the two tab

Re: [PHP-DB] Search engine

2006-09-28 Thread Niel Archer
Hi > What about the MySQL "LIKE" command? Research it. An excellent start for searching a db, but did you miss the point of the question. He wanted to know if anyone had experience with this to save him building from the ground up. I haven't, l so didn't reply If no other help is forthcoming,

Re: [PHP-DB] Search engine

2006-09-29 Thread Niel Archer
Hi Ron This doesn't sound like a Db problem then. You could open each page and use a regex to search for the links. Something like: preg_match_all("/(.*)<\a>/", $page, $matches, PREG_PATTERN_ORDER); which would produce an array ($matches[1]) of the addresses and a array ($matches[2]) of co

Re: [PHP-DB] I still have a bit more of the string to get rid of ...

2006-09-29 Thread Niel Archer
Hiya Ron see my post to your original thread for another answer to this. As noted there though, this is not a DB question, so this is not the list to be pursuing this enquiry. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Array

2006-09-29 Thread Niel Archer
Hi Ron, > how do I put each word into an array (so there would be 12 components in > the array) as well as remove the period and make the C in Check and the > Y in You lower case This isn't a DB question, please ask questions in the appropriate list. But for reference, look up the str_replace, s

Re: [PHP-DB] user directory from a form

2006-10-01 Thread Niel Archer
Hi > I apologise for using this mailing list but I cannot find another. A listing can be found at http://lists.php.net/ Failing finding one more specific, the list to use would be php-general. > I pass this to another file. I am trying to read the directory that the > users file is in. ie "/sr

Re: [PHP-DB] user directory from a form

2006-10-01 Thread Niel Archer
Hi > I would like to extract the path from the users machine Yes, I got that, but you still haven't explained whether you're just not getting the path or don't know how to isolate it Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] How to stop the server timing out

2006-10-03 Thread Niel Archer
Hi, when you say the 'server' times out, do you mean the script reaches it's execution limit (usually around 60 seconds). If that is the case and you have no control over the PHP environment, then there is little you can do to help. The only thing you can do in this situation is to improve the e

Re: [PHP-DB] mysql_error function

2006-10-03 Thread Niel Archer
Hi > The error message for second connection request is not given back to the > PHP. Or as I suppose, mysql_error takes last error message from last used > ESTABLISHED connection (it means from $link1) and since in this connection > was everything ok, it puts empty string as a result of mysql_erro

Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Niel Archer
Hi Make sure that the php.ini file being used is the one you thinkit is. I keep mine in the php directory, so I have to be very careful that I don't accidentally let one get into the Windows folder, becuase that is search first The manual lists the search order. It also has some notes on setting

Re: [PHP-DB] mysql_error function

2006-10-05 Thread Niel Archer
Hi > OK, so there is no way how to get error message about mysql_connect() > function when establishing more connections? mysql_error *should* hold the error string from the last used mysql function (excepting itself and mysql_errno), that includes the mysql_connect() function as it's a mysql fun

Re: [PHP-DB] mysql_error function

2006-10-06 Thread Niel Archer
Hi > OK, so mysql_error is not usable for me in this case. > Is in PHP any other way how to get error-message from connect function? > Isn't in PHP any other function, that can be used similiar? To the best of my knowledge, there is no work around for this situation. Even the 'Improved' MySQL Ex

Re: [PHP-DB] SELECT date query

2006-10-06 Thread Niel Archer
Hi Ron I've made the assumption that if today is Wednesday, you still want next Wednesday. Try this: $offset = array(3,2,1,7,6,5,4); $date = explode("-", date("Y-n-j")); $ToDay = DayOfWeek($date[0], $date[1], $date[2]); $NextWed = date("Y-n-j", time() + ($offset[$ToDay] * 24 * 60 * 60)); // Retu

Re: [PHP-DB] SELECT date query

2006-10-07 Thread Niel Archer
Hi > You can make this easier with date('w'). Doh, that'll teach me to code at 5 am. I knew there was a better way, but couldn't think of it, the sound of my bed calling was too distracting. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsu

Re: [PHP-DB] ECHO $variable

2006-10-07 Thread Niel Archer
Hi Where's the DB question? Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: ECHO $variable

2006-10-07 Thread Niel Archer
Hi > The database part of this is that I just retrieve $saved_message_title > from mySQL and thought it was already escaped and am not sure what went > wrong with the ECHO That doesn't make it a DB question. Not even close. This list is for matters *directly* concerning DB problems. replace:

Re: [PHP-DB] mysql databases

2006-10-13 Thread Niel Archer
Hi Bob Your question isn't very clear. Do you want to remove the oldest entry, newest, or is there some other criteria to diceide? Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql databases

2006-10-13 Thread Niel Archer
Hi > He means that he wants to use REPLACE and take out the old entry and update > it with a new one. Although, you would probably use UPDATE instead. Hmmm... Thought this was DB list, not mind-readers. I would also *guess* that would be the intention, but his example seems to remove the newest e

Re: [PHP-DB] mysql databases

2006-10-14 Thread Niel Archer
Hi Bob First you would need a means of identifying your oldest entry, some kind of Date-Time field would seem simplest. Then, one way, would be to SELECT the oldest value and use it in the 'where' clause of an UPDATE. SELECT MIN(stamp) FROM table; will get the oldest date-time value and UPDAT

Re: [PHP-DB] Verifying syntax executed correctly

2006-10-17 Thread Niel Archer
Hi All of the MySQL functions you used, return FALSE on failure. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] MySQL SQL Query Help

2006-11-13 Thread Niel Archer
Hi Try: SELECT fkid, MAX(foo), bar FROM table GROUP BY fkid ORDER BY bar DESC Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Installation Problem

2006-11-15 Thread Niel Archer
Hi If you're on a windows platform, this will be because MySQL support is built in on v4.1 but not on 5.x. As the others have suggested, uncomment the php_mysql.dll entry in the modules to add it. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP-DB] Special Character

2006-11-16 Thread Niel Archer
Hi Is it really a hyphen, or is it an en- or em-dash. The latter two could mess up in in some character sets. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Special Character

2006-11-16 Thread Niel Archer
Hi David What you describe sounds like Word is auto replacing hyphens with either en- or em-dashes. This is a configurable option in Word that often defaults to on. Try using double quotes, If they get switched to 66's and 99's style quotes, then that is likely the problem. I no longer use MS O

Re: [PHP-DB] Special Character

2006-11-16 Thread Niel Archer
Hi David off the top of my head, the best I can suggest is using PHP's MB functions (lookup mb_string) to allow recognition and then convert them to hyphens. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Special Character

2006-11-16 Thread Niel Archer
Hi Doh... that's 'mbstring' Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Moving phpNuke to phpBB

2006-11-22 Thread Niel Archer
Hi I'm helping out someone move from PHPNuke to phpBB. Only the forums and users need to be moved. Nuke's Db structure for the forums seems to mimic phpBB's closely, which is no great surprise. Any advice or information would be greatly appreciated. For example, anyone know a way to conve

Re: [PHP-DB] Any hints lantin1 utf-8

2006-11-24 Thread Niel Archer
Hi If you're storing non-latin character in a latin-1 table you are bound to get this problem. phpMyAdmin is simply showing you what you put there as far as it is concerned. You should switch to using an alternative encoding for the character set. UTF-8 would likely be best for you. Back up al

Re: [PHP-DB] Any hints lantin1 utf-8

2006-11-24 Thread Niel Archer
Hi I don't use phpMyAdmin myself and I can't remember if it supports UTF-8 encoding Whichever extension that your PHP is using is likely doing a conversion. this is something that the MySQL libraries handle. You can use this to extract the data from the tables and save it. As a test, dump a

Re: [PHP-DB] CSV import to mySql

2006-12-05 Thread Niel Archer
Hi Your example data does have an "invalid field count" The first row has has 7 fields, the other 6. So if you took them from your actual data that's your problem Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Invoking database php file with hyperlink

2006-12-12 Thread Niel Archer
Hi button/hyperlink, no difference. It's the page that is target that does the work Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Limited number of database results

2006-12-13 Thread Niel Archer
Hi use a LIMIT clause in your SQL. Something like: $query="SELECT * FROM WHERE hello = '$hello' LIMIT " . ($page - 1) * $rows . ", $rows"; then you only need specify the logic to set the page, row and limitations Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP-DB] search result error message

2006-12-21 Thread Niel Archer
Hi, there's no 'logic' error at all that I can see. It's more a design error as it doesn't do the job the way that you describe it at all. What actually happens is that the starting HTML (heading and table start) is output before the database is even contacted, so there's no way for you to ta

Re: [PHP-DB] CURL and process not finishing

2007-01-06 Thread Niel Archer
Hi Are you running this as CLI or from your web-server? If the latter, use phpinfo() and check the max_execution_time isn't causing you problems. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql rereading result set (fetch_assoc)

2007-01-06 Thread Niel Archer
Hi > I'm running thru a result set using fetch_assoc. Now I want to run through > it again. > > How? Save each row into an array first time around, then reset the array pointer to the beginning, would be one way. Or assuming you're using the original MySQL functions, use mysql_data_seek(0

Re: [PHP-DB] Error for registration mail.

2007-01-07 Thread Niel Archer
Hi You have two functions between the if and else, the syntax you've used only allows one. Use braces. if(mysql_query($sql)) { mail ($email, "Thank you for registering!", $body, "From: [EMAIL PROTECTED]"); header("Location: thankYou.php"); } else { die("Error! Could not insert values".m

Re: [PHP-DB] Syntax Error

2007-01-07 Thread Niel Archer
Hi is the syntax error reported for the php or the SQL? Better yet, supply the actual error message, so we can see for ourselves Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] CURL and process not finishing

2007-01-09 Thread Niel Archer
Hi > leaving me with the question: what does > max_execution_time relate to? is it more like a maximum time without > activity. max_execution_time is the time php gets to execute code. From the documentation: "The maximum execution time is not affected by system calls, stream operations etc. P

Re: [PHP-DB] mysql rereading result set (fetch_assoc)

2007-01-09 Thread Niel Archer
Hi > Hi, I would ask which way is more efficient and save time? Save each row to > array or mysql_data_seek(0) ? That totally depends on which resources are more valuable to you. The array will likely use more memory but be faster to process. While mysql_data_seek(0) would probably use n

Re: [PHP-DB] Formatting MySQL Queries

2007-01-24 Thread Niel Archer
Hi SELECT * FROM table INTO OUTFILE 'file_name' FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] What effects MySQL connection's character set

2007-01-26 Thread Niel Archer
Hi all How is the character set of returned data effected? I have a DB using UTF-8 encoding., PHP is set to use UTF-8 internally. However the MySQL connection returns Latin1 data. How can I get it to return UTF-8 data instead. TIA Niel -- PHP Database Mailing List (http://www.php.net/) To un

Re: [PHP-DB] Am I missing something?

2007-01-27 Thread Niel Archer
Hi you need to change this: > $insert = 'INSERT INTO domains ( picture, thumbnail ) values( "$picture", > "$thumbnail")'; to be: $insert = "INSERT INTO domains ( picture, thumbnail ) values( '$picture', '$thumbnail')"; variables are only interpreted inside double quoted strings. Within single

Re: [PHP-DB] Am I missing something?

2007-01-27 Thread Niel Archer
Hi > Alright, I did that. I now get : > INSERT INTO domains ( picture, thumbnail ) values( '', '') > > and no data entered. Then for some reason your variables are empty. Make sure they have data on entry to the function. If they don't keep backtracking until you find where it's lost. Niel

Re: [PHP-DB] can u help me in PHP

2007-01-28 Thread Niel Archer
Hi > I read ur reply on newsreader abou mysqli and if i can use it in PHP4 > > My question is where can i find a link to download the mysqli extension > separately without changing to PHP5 The MySQLi extension is available before PHP v5, but I couldn't tell exactly which version it was introdu

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread Niel Archer
Hi Try using: SHOW COLUMNS FROM db.table LIKE 'field_name%' and from the returned row, check the 'Extra' column for 'auto_increment' Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] What effects MySQL connection's character set

2007-01-30 Thread Niel Archer
Hi Chris. Thanks for this. That page didn't actually help, but one of the follow ups did. Apparently, despite being setup as UTF-8 throughout the Db, tables, and columns. The returned data still can default to Latin1. I've forced my test server to return UTF-8 (I hope) and am trying it out t

Re: [PHP-DB] What effects MySQL connection's character set

2007-01-30 Thread Niel Archer
Hi > Thanks for this. That page didn't actually help, but one of the follow > ups did. Apparently, despite being setup as UTF-8 throughout the Db, > tables, and columns. The returned data still can default to Latin1. > I've forced my test server to return UTF-8 (I hope) and am trying it > ou

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread Niel Archer
Hi John, I'd suggest searching within the Extra field instead of testing for the value explicitly, as this field can theoretically hold several extra pieces of information. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] What effects MySQL connection's character set

2007-01-31 Thread Niel Archer
Hi all Finally identified the problem. Was pretty obvious in retrospect. The mysqli class (Improved MySQL extension OO style) defaults to latin1 as a character set, regardless of what PHP is using. Simple solution is to use the set_charset method (mysqli_set_charset for non OO) on the object

Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-04 Thread Niel Archer
Hi. I don't know cPanel, but I expect it can run SQL directly, most panels can. Use the ALTER TABLE ADD {INDEX|KEY} syntax to add indexes/primary keys. You can use multiple columns, which together form a unique value to create your primary key. Niel -- PHP Database Mailing List (http://www.

Re: [PHP-DB] csv problem.. read csv from var

2007-02-15 Thread Niel Archer
hi > the problem i have is.. how about the csv is a var > DATA=== > $csv=" > A507257,3/2/2007,\"Hematologi Lengkap,Cholesterol Total,LDL > Cholesterol,Trigliserida,HDL Cholesterol,Asam Urat,Gula Darah Puasa,Gula > Darah 2 Jam PP,Kreatinin,Ureum,Bilirubin Total,A

Re: [PHP-DB] csv problem.. read csv from var

2007-02-16 Thread Niel Archer
Hi sorry, I misunderstood your problem, it was not too clear to me as the code you list shouldn't produce the output you supplied. try this: $array = explode(',', $csv); print "= " . $array[0] . "\n"; print "= " . $array[1] . "\n"; for ($i = 2; $i < count($array); ++$i) { $txt.= "=" . $array[

Re: [PHP-DB] Urgent! Installing PHP 4 on 64-bit machines

2007-03-06 Thread Niel Archer
Hi > I need urgent help. Have anyone successfully installed PHP 4 & MySQL 4.0 on > 64-bit Windows? Frankly, why would you want to? Neither are written for 64 bit. The only versions I could find for 64 bit were the 5.x versions in both. Which is what I run on my personal computer. Niel --

Re: [PHP-DB] Urgent! Installing PHP 4 on 64-bit machines

2007-03-07 Thread Niel Archer
Hi I've only had MySQL 4.1 running on 64 bit windows and PHP 5.x, without any real problems when used locally. However, there seemed to be a problem using the MySQL server via TCP/IP, hence the upgrade to native 64 bit version (v5.0), which was not desired at the time but seemed to be the only fi

Re: [PHP-DB] do not display dublicated entries

2007-03-13 Thread Niel Archer
Hi First, unless there is a compelling reason not to, I'd suggest you use a single date field, instead of separate year, month, day columns. It will be much more efficient on space and indexes. Then, based on your own query, use: SELECT DISTINCT ip, date FROM tracker WHERE page = 'index' ORDE

Re: [PHP-DB] Re: do not display dublicated entries

2007-03-14 Thread Niel Archer
Hi > I have tried everything except of the one that forms the date in one field > and use the DISTINCT for ip and date. It works for me. I use it for essentially the same job, listing most recent visit to a location (not IP, but physical venue). Have you tried adapting it to your needs, such as

Re: [PHP-DB] Inheritance question

2007-03-19 Thread Niel Archer
Hi > For example (see below), lets say I would like to use "public $one" > property in a new class / method (such as class b)? What is the > best way to accomplish this? Any help and or suggestions are welcome. > > class a { > public $one; > > public function someMethod() { >

Re: [PHP-DB] sunrise / sunsite / correcting for summer time

2007-03-25 Thread Niel Archer
Hi, see the docs for the date() function. 'I' returns 0 or 1 indicating Daylight Saving Time. However, it does this based on the settings for your installation. i.e. if your webserver is running on a host configured to U.S. time zone, it'll give U.S. DST results. Note that, any method will

Re: [PHP-DB] problems with functions/included files/mysql resource

2007-03-27 Thread Niel Archer
Hi, > > In the function to connect to and select the database, I make the mysql-link > resource a global value. It sounds like you've misunderstood 'global' variable. The global statement needs to go inside the function where you want to use the variable, not where you assign it. This tells th

Re: [PHP-DB] 20K photos

2007-04-29 Thread Niel Archer
Hi > Imagine that you want to put some 2 historical photos On display in > your website , you use PHP and MySQL. > Preparing a photo album with 200 photos is no problem but for 2 photos! > would you do it in the same way? Yes, but I don't necessarily see the need for a db. If y

Re: [PHP-DB] tell mysql error

2007-06-05 Thread Niel Archer
Hi > mysql -h localhost -u root -p 123456 should be: mysql -h localhost -u root -p123456 notice no space after -p or it asks for the password. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] tell mysql error

2007-06-08 Thread Niel Archer
Hi Sounds like you do not have the required privileges with your user account.. I suggest you spend some time reading the MySQL documentation on privileges. Are you using the root account? Have you created other user accounts and given them the required privileges? Niel -- PHP Database Mail

Re: [PHP-DB] tell me syntax

2007-06-12 Thread Niel Archer
http://dev.mysql.com/doc/refman/5.1/en/grant.html Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Problem with rss-feed generation

2007-06-15 Thread Niel Archer
Hi the first line is badly formed Should be: Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Problem with rss-feed generation

2007-06-15 Thread Niel Archer
Hi > ok by beginning the php-code with Unfortunately my RSSowl tell me that there must be other errors in the > xml-formating. And I don't got a detailed information what RSSowl > dislike in the xml-file. Try opening it in a browser. Opera, for example, tells you what error it encounters. That'

Re: [PHP-DB] Problem with rss-feed generation

2007-06-15 Thread Niel Archer
Hi > firefox tells me that it dislike the closing xml-tag. > In my quanta-editor it seems that can be difficulties with the tagend of > the opening xml-line of the second position of the questionmark. Because you missed the space in front of it. You really need to find out more about XML and RS

Re: [PHP-DB] Problem with rss-feed generation

2007-06-15 Thread Niel Archer
Hi > Du you know a good tutorial for XML and RSS, possible relating with PHP. Not a tutorial, no. I got my information from the specification documents. You should consider changing your method. Instead of creating the RSS/XMl file manually, try using one of the PHP extensions that will genera

Re: [PHP-DB] how to delete

2007-06-19 Thread Niel Archer
Hi There is no DESTROYIMAGE() function. May be you mean imagedestroy(). If so this does NOT erase files, it destroys in memory images created using the Image functions. To erase files use the unlink function. For detail look here http://uk3.php.net/unlink Niel -- PHP Database Mailing List (

Re: [PHP-DB] Catchable fatal error: Object of class stdClass could not be converted to string in on line

2007-06-25 Thread Niel Archer
Hi Seeing as no-one else has replied to this, I'll make a comment. First off let me state I don't use PDO so I am not familiar with it. It would appear to me that your "problem" line is NOT the problem. It is only where the error is reported from. That line is a call to an object method, so the

Re: [PHP-DB] Re: record pointer

2007-07-05 Thread Niel Archer
Hi > O.K. the id column is primary key and it is auto_incerment .I think my > explanation was not clear enough : > > this is my query : SELECT * FROM table WHERE ID=$ID > this will find the record with the specified ID and I will be able to see > it, now I want to be able to scroll up and

Re: [PHP-DB] Re: record pointer

2007-07-05 Thread Niel Archer
Hi > mysql> select id,cat from table where cat=(select cat from table where id=51); > +-+--+ > | id | cat | > +-+--+ > | 40 | FLK | > | 41 | FLK | > | 42 | FLK | > | 44 | FLK | > | 45 | FLK | > | 46 | FLK | > | 47 | FLK | > |

Re: [PHP-DB] Newbie alert: supplied argument is not a valid MySQL result resource

2007-07-09 Thread Niel Archer
Hi On my way to bed so too tired too look closely, but at a guess I'd say it's a logic error. I would guess this: >$sid = mysql_fetch_array($query) || die ('Could not fetch from database: > ' . mysql_error()); // <--- line 49 isn't evaluating in the order you expect.. You're using a lo

Re: [PHP-DB] __CYGWIN32__

2007-08-06 Thread Niel Archer
kage to allow a Unix-Like environment. You need a list like the developers one, where they're more knowledgeable with building PHP/MySQL -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] showing warnings

2007-09-11 Thread Niel Archer
le. Assuming that 'Tune_Name' contains unique entries for each row, I'd suggest you do the following as a minimum: ALTER TABLE Mobile_Tunes ADD PRIMARY KEY (Tune_Name); -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] showing warnings

2007-09-11 Thread Niel Archer
f there are > only 4 rows in the table. True, but if it was only ever going to have 4 entries in it I doubt he'd be using a Db at all. I'm assuming this is just a sample. -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Query syntax

2007-09-15 Thread Niel Archer
If I understood you correctly (and I'm not sure I did), this should do it $query="SELECT * FROM table WHERE listing_type LIKE '%$listing_type%' AND listing_approved IN( '1' ,'2') ORDER BY name ASC"; -- Niel Archer -- PHP Database Mailing List (htt

Re: [PHP-DB] Pages not fully loading

2007-09-24 Thread Niel Archer
pt. Without seeing the code, No! -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Data not fetching in the textfield.

2007-09-26 Thread Niel Archer
Your variable value is not being inserted because you have used single quotes for the echo, not double quotes as the nabble example does. Special characters and variables are only interpreted in double quotes, they are treated literally in single quotes. -- Niel Archer -- PHP Database Mailing

Re: [PHP-DB] Inserting databasecontent within the same form

2007-09-26 Thread Niel Archer
uld also process the City.name and City.vorwahl results for NULL results where `zipcode` does not exist in the "City" table. -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Inserting databasecontent within the same form

2007-09-27 Thread Niel Archer
t; know why. Dynamically changing the fields, I'm afraid I can't help. You would be better trying a list dedicated to ajax. -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Variables & Forms

2007-10-17 Thread Niel Archer
which involves using the CR+LF+white-space combination to indicate multiple line entries. Is it possible your e-mail header fields are doing this and your access to the headers does not take this possibility into account? Without your POP handling code it's impossible to say whether this is y

Re: [PHP-DB] php maximum characters in text field

2007-10-17 Thread Niel Archer
Hi > Does anyone know how to look for a "Curly quote" or "typographer's quotation > mark". Do you mean the equivalent of the left and right double quote entities in HTML (or 66's and 99's as we called them at school)? -- Niel Archer -- PHP Datab

Re: [PHP-DB] Select...

2008-01-15 Thread Niel Archer
d to do a join between the two tables using the common column to make the connection. This should get you started SELECT * FROM Table1 RIGHT JOIN Table2 USING (idequipomed) WHERE Table1.idequipomed IS NULL -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Help to improve MySQL query

2008-08-08 Thread Niel Archer
Hi You do not say how you identify the last call (there is no date/time field for example), so a complete answer is not really possible Do not use "NOT LIKE 'Completed'", it's an inefficient way of doing "!= 'Completed'" -- Niel Archer -- PHP D

Re: [PHP-DB] If( Query)

2008-09-07 Thread Niel Archer
ou should be checking the mysql_query call for success and output the error if it fails. Something like: mysql_query($sql) or die('Insert failed: ' . mysql_error()); You'll now why it's failing then. Make sure you have error reporting enabled. > Is this a compatability error? or is there a better way to write this? > -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] solution reqd for summation of vertical columns in PHP

2008-09-14 Thread Niel Archer
COUNT returns the number of rows. I think they're after SUM SELECT SUM(price) WHERE available = 1; would total the values in the returned row's price column -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Bulk Insert from text file

2008-09-25 Thread Niel Archer
these accordingly. You may need to add an extra backslash to escape the backslash for phpMyAdmin, I do not remember how that works with phpMyAdmin. -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Not Valid URL

2009-02-23 Thread Niel Archer
Kamil Walas Check the file containing the first link again. '%5c%22' is the characters '\"'. Seems you have escaped the double quotes in a single quoted string > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysqli error

2009-07-01 Thread Niel Archer
single time I loop through. Is there any way that I > can run these statements error-free without having to close the select > statement ($sth1) every single time I want to execute my update statement > ($sth2)? You do not initialise your statement object. I would guess this is a large part of the problem, although I'm not that familiar with prepared statements in MySQLi. See the documentation for mysqli::stmt_init[1] and the example for mysqli_stmt::prepare[2] in the php documentation. [1] http://docs.php.net/manual/en/mysqli.stmt-init.php [2] http://docs.php.net/manual/en/mysqli-stmt.prepare.php > Thanks, > Kevin -- Niel Archer niel.archer (at) blueyonder.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql_insert_id() and JOIN

2009-07-11 Thread Niel Archer
he last 'id' column generated, which you can then use to insert data into the secondary tables. > > I’m not to do a link between tables in PHPMyAdmin? > > > > Thank you very... VERY... much! > If you are using MySQL 4.1 or later you should use the mysqli extension and

Re: [PHP-DB] Re: [PHP] A prepared statements question

2009-07-12 Thread Niel Archer
> [email protected] || [email protected] > http://www.parasane.net/ || http://www.pilotpig.net/ > Check out our great hosting and dedicated server deals at > http://twitter.com/pilotpig > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql_insert_id() and JOIN

2009-07-12 Thread Niel Archer
ano Boragina _ >// Diseño & Comunicación ////// -- Niel Archer niel.archer (at) blueyonder.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] simple INSERT statement with placeholders failing. I don't understand why.

2009-07-13 Thread Niel Archer
e to start looking. You are mixing up several different methodologies in the example you show. More generally for MySQLi start here: http://uk.php.net/manual/en/book.mysqli.php It has links to the appropriate function references for the MySQL Improved interface. > > -- > PHP Datab

Re: [PHP-DB] Single Quotes in Form Inputs

2009-07-27 Thread Niel Archer
ute minimum you should be doing with any data you do not supply yourself > $query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`) > VALUES ('$firstName','$lastName')"); > > > > Ben Miller BTW ereg functions are deprecated in PHP 5.3, so now

Re: [PHP-DB] Single Quotes in Form Inputs

2009-07-27 Thread Niel Archer
if my reading of the documentation is correct. But as far as I can tell no escaping is performed on PDO::query or PDO::exec other than what you do yourself, so you have the same risks that need to be addressed. > -- Niel Archer niel.archer (at) blueyonder.co.uk -- PHP Database Mailing L

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Niel Archer
mysql_query("SELECT DISTINCT DATE(solarLandingDateTime) AS solarLandingDate, solarLandingIP, solarLandingDir, solarLandingDateTime FROM ".$whichTable. " ORDER BY solarLandingDateTime DESC LIMIT $Maxrecs2Show") or die("query failed: " . mysql_error());> If you are al

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-02 Thread Niel Archer
ndingDir, solarLandingDateTime > FROM ".$whichTable. > " ORDER BY solarLandingDateTime DESC > LIMIT $Maxrecs2Show") or die("query failed: " . mysql_error());> Oops, forgot to mention that with the alias you can change the ORDER BY clause to use t

  1   2   >