<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rss version="2.0"><channel><title>Java, PHP, MySQL, Ruby, and more at Sagewire.org</title><link>http://www.sagewire.org/</link><description>Blogs and forums for Java, PHP, MySQL, and more.</description><language>en</language><item><title>Advice wanted on backing up large databases</title><link>http://www.sagewire.org/php-sql/Advice-wanted-on-backing-up-large-databases-1998067.aspx</link><description>Hi
First off what I'm trying to do is export my mysql database to a file on my
server, preferably with an option of emailing it in compressed format. I have
tried quite a few mysql database backup programs, all of which work on a
small test database but all fail when trying to export an 10Mb+ database. I
get an the message 'Internal Server Error, this is an error with your
script, check your error log for more information.' My servers error log is
always empty. I assumed the problem was a...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Advice-wanted-on-backing-up-large-databases-1998067.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 06:56:37 GMT</pubDate></item><item><title>How to delete \r\n after using Navicat in phpmyadmin/Navicat?</title><link>http://www.sagewire.org/php-sql/How-to-delete-rn-after-using-Navicat-in-phpmyadmin-1991213.aspx</link><description>I have converted a xml-file to mysql with Navicat but the problem with the 
xml-file was that the end of line code was not changed before I used Navaicat 
so I had to look for it manually and change it in there but in Firebug I 
still saw this code \r\n.

I have been told that this \r\n is characters 13,10 (CR, LF) and is the 
standard DOS sequence for end-of-line.

Now when I try to geocode the adresses from phpmyadmin I got problems and 
now I need help to search for this code and del...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/How-to-delete-rn-after-using-Navicat-in-phpmyadmin-1991213.aspx</guid><author>rss@sagewire.org</author><pubDate>Mon, 22 Oct 2007 17:55:24 GMT</pubDate></item><item><title>problems importing tables</title><link>http://www.sagewire.org/php-sql/problems-importing-tables-1983942.aspx</link><description>hello

I'm a newbie to sql, and i'm having problems importing tables that I have 
exported from another databases.
The problem is that I cannot export the db dump, instead I just the chance 
to export table by table through the hosting control pannel.
Then I went to the new hosting server through php MyAdmin and tried to 
import table by table and it give errors.
Here is an example of an error:

Error
There is a chance that you may have found a bug in the SQL parser. Please 
examine ...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/problems-importing-tables-1983942.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 21 Oct 2007 01:58:36 GMT</pubDate></item><item><title>Slow results</title><link>http://www.sagewire.org/php-sql/Slow-results-1963472.aspx</link><description>Hi there
First off sorry if this is a long posting but I need to give all the facts 
in the hope to get an answer. 2 Years ago I did a site for a client to track 
online orders and run reports. One of the main reports is now going so slow 
it's of no use to anybody.
I am the first to admit that I am not the best PHP and MySQL coder so I may 
be missing something here or I may have just met the limit of MySQL, all 
scripts and DBs are on a modem new dedicated server.
The 2 main tables are...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Slow-results-1963472.aspx</guid><author>rss@sagewire.org</author><pubDate>Mon, 15 Oct 2007 17:02:36 GMT</pubDate></item><item><title>What's wrong with this?</title><link>http://www.sagewire.org/php-sql/Whats-wrong-with-this-1974614.aspx</link><description>I need to find out whos birthdays land today. The DOB is stored in a
standard Unix timestamp. I'm trying to use the following but it throws up a
syntax error. 

SELECT numberx FROM member WHERE date('d m',dob)=date('d m',time())

Where am I going wrong?</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Whats-wrong-with-this-1974614.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 12 Oct 2007 14:15:25 GMT</pubDate></item><item><title>Ignore track?</title><link>http://www.sagewire.org/php-sql/Ignore-track-1961882.aspx</link><description>I have an admin page where auth'd users upload a csv file for
insertion of email addresses into a unique field in a mySQL DB.

Using &amp;quot;INSERT IGNORE&amp;quot; how do I track the occurence of an ignore?

I'd like to print a message saying something like &amp;quot;X email addresses
were duplicates and weren't inserted into the DB.&amp;quot;

I believe ignore are written to binary log file. Is there a way to
track these writes to the log file for output to a php error message?

TIA
Matt Mika</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Ignore-track-1961882.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 04 Oct 2007 15:30:22 GMT</pubDate></item><item><title>import / export between servers</title><link>http://www.sagewire.org/php-sql/import-export-between-servers-1940455.aspx</link><description>Hi all!

I hope someone can help me with this... :)

I am again moving a site to another server and I am again amazed how low the
script limitations are (upload file size), how cr***y the consoles are and
how unnerving the whole process is. It has taken me 3 hours just to move
the DB and I have just now noticed that the codepage is invalid - even
though I have specified it correctly in phpMyAdmin. Let's start again... :(

So the idea is - why not write two PHP scripts, one for the sour...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/import-export-between-servers-1940455.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 03 Oct 2007 18:02:43 GMT</pubDate></item><item><title>Count across 3 tables</title><link>http://www.sagewire.org/php-sql/Count-across-tables-1945079.aspx</link><description>I have got a few different tables that track video game consoles people
use in their profile. The tables are below. I'm trying to do two
counts/sorts and display them properly.

(1) sort the fields by country
(2) In each country, display the number consoles owned by members
sorted by brand and model. So it should output like this:

country, brand name, model number, number of owners
US, microsoft, xbox1, 5432
US, sony, playstation1, 4345
US, sony, playstation2, 5456
Mexico, microsoft...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Count-across-tables-1945079.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 02 Oct 2007 10:13:46 GMT</pubDate></item><item><title>How to select fields form two tables, where one is containing some text+field form other table+some text</title><link>http://www.sagewire.org/php-sql/How-to-select-fields-form-two-tables-where-one-1957855.aspx</link><description>I have a problem - I need to select fields from two tables, where
field form table1 contains text + table2.id + text.

I have table reservations which has clients field. clients contains
client's id (taken from table2) with client's options. It's syntax is
like

|61=[49!130]&amp;amp;[50!15]|62=[49!130]&amp;amp;[50!15]|
where each |client.id=[option.id!value]&amp;amp;[option.id!value]|

the problem is that I need to secect specific reservation which
contains a client's data within one select statement.

So,...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/How-to-select-fields-form-two-tables-where-one-1957855.aspx</guid><author>rss@sagewire.org</author><pubDate>Mon, 01 Oct 2007 16:46:06 GMT</pubDate></item><item><title>Whats the most portable way to identify field existence?</title><link>http://www.sagewire.org/php-sql/Whats-the-most-portable-way-to-identify-field-exis-1945720.aspx</link><description>Thats field not table - 

I just want to see if a particular field exists in a specified table and 
for the method to work reliably on as many mySQL versions as possible. 

Obviously the most efficient'd be best  - I can not see anything in the
mySQL docs to do this. Did I miss it?

thanks.

Tom.</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Whats-the-most-portable-way-to-identify-field-exis-1945720.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 27 Sep 2007 10:26:51 GMT</pubDate></item><item><title>Compare every word in paragraph with every row in database</title><link>http://www.sagewire.org/php-sql/Compare-every-word-in-paragraph-with-every-row-in-1948037.aspx</link><description>My problem is I want to compare every word in large paragraph with
every row in database.But this technique use to much process and slow
down query performance.e.g.

My paragraph:
&amp;quot;This is my very very large paragraph&amp;quot;

My table in MySQL contains this keyword :

book
------------
this
------------
hello
------------
car
------------
very
------------

So first I'll compare the word 'This' with data in every row
(book,this,hello,car,very) then following by word 'is','my',..
...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Compare-every-word-in-paragraph-with-every-row-in-1948037.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 26 Sep 2007 17:21:06 GMT</pubDate></item><item><title>SQL question and query result</title><link>http://www.sagewire.org/php-sql/SQL-question-and-query-result-1941340.aspx</link><description>I am new to this SQL.  Can someone answer this question for me?
1.   Given the following schema of an employees table:*employees (*

*  empid    integer primary key, -- employee id number*

*  dept     string,              -- the employee's department number*

*  salary   float,               -- salary of the employee*

*  mgrid    integer              -- employee id number of employee's
manager*

*)*Write the query (or queries if necessary) needed to count the number
of employees i...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/SQL-question-and-query-result-1941340.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 21 Sep 2007 10:59:41 GMT</pubDate></item><item><title>help with db_host</title><link>http://www.sagewire.org/php-sql/help-with-dbhost-1940582.aspx</link><description>Hello:

I have inherited a system for which I not only need to maintain php code, 
but also server as the system administrator.

I need to run some blog software and I need to know how to discover what my 
db_host is set to or how to set my db_host.

The software requires this in order to run.

This is an absurdly fundamental question, but I am stuck with it.  I have not 
had much luck finding this via the mysql documentation on the the website.thanx

Dan</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/help-with-dbhost-1940582.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 20 Sep 2007 15:52:33 GMT</pubDate></item><item><title>php5 mysql5.0 win problems</title><link>http://www.sagewire.org/php-sql/php5-mysql50-win-problems-1931969.aspx</link><description>I have problem with my php/sql code because id (auto inc., primary) row.
(
    $sql =  &amp;quot;INSERT INTO &amp;quot;.$_CONF['tprefix'].&amp;quot;schedule_scores VALUES &amp;quot;;
    $sql .= &amp;quot;('NULL','$newdate','$newtime','$newlocation','$team1_id',&amp;quot;;
    $sql .= 
&amp;quot;'$team2_id','$team1_div','$team2_div','$newteam1_score','$newteam2_score',&amp;quot;;
    $sql .= &amp;quot;'$newseason','','','','','','1')&amp;quot;;

)

this is code and I done this

(
    $sql =  &amp;quot;INSERT INTO &amp;quot;.$_CONF['tprefix'].&amp;quot;schedule_scores (date, time, 
location,
    ...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/php5-mysql50-win-problems-1931969.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 16 Sep 2007 14:38:29 GMT</pubDate></item><item><title>session_start problem in php5</title><link>http://www.sagewire.org/php-sql/sessionstart-problem-in-php5-1933757.aspx</link><description>Some of my php files start with [code]&amp;lt;?php session_start(); ?&amp;gt;[/code]
Up to recently this was no problem. Recently my provider upgraded from
php4 to php5. From then I get this message:

Warning: session_start() [function.session-start]: SAFE MODE
Restriction in effect. The script whose uid is 522 isn't allowed to
access owned by uid 0 in (...path..)/starttest.php on line 1

Fatal error: session_start() [[code]&amp;lt;a
href='function.session-start'&amp;gt;[/code]function.session-start[code]&amp;lt;/a&amp;gt;[/cod...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/sessionstart-problem-in-php5-1933757.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 16 Sep 2007 08:32:52 GMT</pubDate></item><item><title>Unique constraint for the columns doesn't work when one of values is null.</title><link>http://www.sagewire.org/php-sql/Unique-constraint-for-the-columns-doesnt-work-when-1931645.aspx</link><description>I have a table with a unique constraint on two integer columns.
Works fine, but one of the two columns can be null and then the
constraint doesn't work.
1    2    : OK
1    3    : OK
1    2    : error
2    null : OK
2    null : OK -&amp;gt; I want this to result in an error

Pugi!</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Unique-constraint-for-the-columns-doesnt-work-when-1931645.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 14 Sep 2007 15:11:48 GMT</pubDate></item><item><title>Problem Getting MS SQL Data With Single Quotes</title><link>http://www.sagewire.org/php-sql/Problem-Getting-MS-SQL-Data-With-Single-Quotes-1930909.aspx</link><description>I'm having difficulty getting data out of Microsoft SQL Server via a PHP
database call.  When I look in the database, it crashes on the line
where there is a single quote in the database.  I have seen several
articles about addslashes/stripslashes and str_replace for Microsoft SQL.
Had the data been put in the right way, there'd be no problem.
Or, if I had rights to use UPDATE/SET to modify all lines with single
quotes, again there'd be no problem. The problem is there is no
way for me to...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Problem-Getting-MS-SQL-Data-With-Single-Quotes-1930909.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 13 Sep 2007 19:39:03 GMT</pubDate></item><item><title>SQL Query Problem</title><link>http://www.sagewire.org/php-sql/SQL-Query-Problem-1924578.aspx</link><description>Hi,

I am having a problem with a search.  Below is the code:

$colname_rs_product = &amp;quot;-1&amp;quot;;
if (isset($_GET['search'])) {
  $colname_rs_product = (get_magic_quotes_gpc()) ? $_GET['search'] : 
addslashes($_GET['search']);
}
$colname2_rs_product = &amp;quot;-1&amp;quot;;
if (isset($_GET['search'])) {
  $colname2_rs_product = (get_magic_quotes_gpc()) ? $_GET['search'] : 
addslashes($_GET['search']);
}
mysql_select_db($database_conn_nav, $conn_nav);
$query_rs_product = sprintf(&amp;quot;SELECT * FROM tblProducts...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/SQL-Query-Problem-1924578.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 13 Sep 2007 12:38:43 GMT</pubDate></item><item><title>Counting problem with Query</title><link>http://www.sagewire.org/php-sql/Counting-problem-with-Query-1928400.aspx</link><description>Here's the problem:

I have meeting minutes that need to be paged through via my website.  I have 
created a developer server on my local machine and when I run the PHP code 
against the MySQL table that I imported from my ISP's website everything 
works fine.  However, when I upload the PHP pages to the ISP's server 
everything connects but it does not page through anymore.  It just sits on 
the latest created page.  I click the previous button and it shows it 
reading but nothing happe...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Counting-problem-with-Query-1928400.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 13 Sep 2007 10:50:59 GMT</pubDate></item><item><title>Learning MySQL</title><link>http://www.sagewire.org/php-sql/Learning-MySQL-1919378.aspx</link><description>I'm new to the world of programming and all, what I'd like to know 
is how to create MySQL databases and resources that'd help an 
aspiring programmer like myself at getting the hang of the whole world 
of MySQL, I love the idea of writing dynamic websites and such are ther 
like editors for MySQL databases? I am like totally clueless</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Learning-MySQL-1919378.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 09 Sep 2007 20:27:49 GMT</pubDate></item><item><title>problem saving an excel file</title><link>http://www.sagewire.org/php-sql/problem-saving-an-excel-file-1924474.aspx</link><description>i have a php script to convert a simple query into an excel format
file (tab delimited) which is called mysql-to-excel. on the author's
website when I click on the script I download an xls file, but when I 
do the same on my server it just echos back the query without saving a
file. any ideas. here is the script:

[code]&amp;lt;?php
include 'config.php';
include 'opendb.php';

$query  = &amp;quot;SELECT * FROM information ORDER BY lastname&amp;quot;;
$result = mysql_query($query) or die('Error, query failed');...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/problem-saving-an-excel-file-1924474.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 09 Sep 2007 16:22:25 GMT</pubDate></item><item><title>search script problem</title><link>http://www.sagewire.org/php-sql/search-script-problem-1909422.aspx</link><description>I have written my first search script and I have 2 problems. First, I'm
getting duplicate results because I have identical questions related
to different topic_id's (aka categories). Second, if a search term
is not found, it's
not displaying the &amp;quot;No search results&amp;quot; text on the last line. Any help
would be greatly appreciated.

[code]&amp;lt;?php

 $searchTerms = $_POST['search_term']; $searchSection =
$_POST['search_type'];

 if($searchSection == 1) {

 require_once 'db_connector.php';
...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/search-script-problem-1909422.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 09 Sep 2007 13:33:17 GMT</pubDate></item><item><title>Error with &lt; in SQL</title><link>http://www.sagewire.org/php-sql/Error-with-in-SQL-1916277.aspx</link><description>I have started using the new mysql_* extensions.  Here is the code I am 
trying to run:
	$temp2 = &amp;quot;SELECT * FROM assignments2 WHERE daydue &amp;lt; '247' &amp;amp;&amp;amp; progress != 
'100'&amp;quot;;
	$temp2 = mysqli_query($mysqli,$temp2) or die(mysqli_error($mysqli));
	$temp2 = mysqli_fetch_array($temp2) or die(mysqli_error($mysqli));

This query does not work (though it throws no errors).  Only when I change 
the &amp;quot;&amp;lt;&amp;quot; to &amp;quot;&amp;lt;=&amp;quot; does the script work.  Why does not the less than operator 
work?</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Error-with-in-SQL-1916277.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 06 Sep 2007 08:42:36 GMT</pubDate></item><item><title>ADOdb w/MySQL</title><link>http://www.sagewire.org/php-sql/ADOdb-wMySQL-1918876.aspx</link><description>A few years back I did a little piece using PHP/MySQL (just before the days 
of register globals being turned off).

I am aware of mysql escape string but understand that ADOdb is the preferred 
solution nowadays.

How can I test if a host supports ADOdb for MySQL? I can not see anything in 
phpinfo and I am wary of picking up outdated information from Google. (a bit 
like still finding PHP scripts that depend on register globals being ON).Thanks in advance.</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/ADOdb-wMySQL-1918876.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 05 Sep 2007 01:23:03 GMT</pubDate></item><item><title>simple query question</title><link>http://www.sagewire.org/php-sql/simple-query-question-1915713.aspx</link><description>Hi all, 
	I have got a php function which asks mysql the following question...

	&amp;quot;select * from data where id='$id' and parent='$parent' and node='$node'&amp;quot;

	Now, I do not need to &amp;quot;select *&amp;quot;, because the function is simply supposed
	to return true if the data exists in the database, so how do I get the
	query to return true if the data exists, and false if it does not. 

Thanks, 

Tony.</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/simple-query-question-1915713.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 02 Sep 2007 06:50:58 GMT</pubDate></item><item><title>Probleme mysql_connect : Connaissez ?</title><link>http://www.sagewire.org/php-sql/Probleme-mysqlconnect-Connaissez-1912188.aspx</link><description>Paris,
Le 30 08 MMVII,

Hi,

I have a problem : MYSQL from one server and PHP on another server.

In other words, On server A, I have my PHP files, and on server B, I
have MySQL installed.
Localhost is fine, but an I.P. as a host lead to an error : Warning:
mysql_connect(): can not connect to MySQL server on '207

Here is what I got :

1) CONFIG.PHP
   $dbtype = &amp;quot;mysql&amp;quot;; ##Defines Database type
   $dbhost = &amp;quot;207.36.15.13:3306&amp;quot;; ##Your host
   $dbuname = &amp;quot;maincontheaderbox&amp;quot;; ##Da...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Probleme-mysqlconnect-Connaissez-1912188.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 30 Aug 2007 12:28:08 GMT</pubDate></item><item><title>mysql_connect : Here OUTSIDE connection.</title><link>http://www.sagewire.org/php-sql/mysqlconnect-Here-OUTSIDE-connection-1912068.aspx</link><description>Paris,
Le 30 08 MMVII,

Hi,

I have a problem to connect to MYSQL from one server to another
server.

In other words, On server A, I have my PHP files, and on server B, I
have MySQL installed.
Localhost is fine, but an I.P. as a host lead to an error : Warning:
mysql_connect(): can not connect to MySQL server on '207

Here is what I got :

1) CONFIG.PHP
   $dbtype = &amp;quot;mysql&amp;quot;; ##Defines Database type
   $dbhost = &amp;quot;207.36.15.13:3306&amp;quot;; ##Your host
   $dbuname = &amp;quot;maincontheaderbox&amp;quot;;...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/mysqlconnect-Here-OUTSIDE-connection-1912068.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 30 Aug 2007 10:26:25 GMT</pubDate></item><item><title>Finding Acute-e</title><link>http://www.sagewire.org/php-sql/Finding-Acutee-1909547.aspx</link><description>Hi,

Does anyone know how to query a varchar field to bring back any records 
containing an acute-e - that's the &amp;quot;&amp;#233;&amp;quot;

The table is set to Colldation: latin1_swedish_ci

I have tried a number of things but nothing seem to work - it seem to return 
records that contain any type of e.

Thanks,

SteveK</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Finding-Acutee-1909547.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 28 Aug 2007 09:46:07 GMT</pubDate></item><item><title>Format datetime with query?</title><link>http://www.sagewire.org/php-sql/Format-datetime-with-query-1903904.aspx</link><description>Is there a way to format datetime (2007-08-23 07:00:00) into something
like Aug. 23rd, 2007 7am within a query?

A little explanation. This is an events table that is queried from a
PHP class triggered from flash via AMFPHP, the mysql result is then
sent back to Flash.

I plan of having php forms to add, edit and delete entries in this
table so was thinking I could just have a datetime field and a
format_date field that'd get a formatted version of the datetime
when inserted or updated...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Format-datetime-with-query-1903904.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 24 Aug 2007 17:46:00 GMT</pubDate></item><item><title>MAXIMUM LENGTH OF LONGTEXT FIELD</title><link>http://www.sagewire.org/php-sql/MAXIMUM-LENGTH-OF-LONGTEXT-FIELD-1904794.aspx</link><description>Hi all
Have been to the MySQL help pages trying to find out
how many characters (Latin set) I can load into a LONGTEXT
field.  It tells me:
L characters + 4 bytes, where L [code]&amp;lt; 232

Which I am afraid to say means nothing to me as a newbie user.
So, in plain english, how many normal characters/words will
the field accept  and does a very long entry slow the search
down if the search is on other fields and not the LONGTEXT
field?

While I am here, a couple more questions please.
1....</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/MAXIMUM-LENGTH-OF-LONGTEXT-FIELD-1904794.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 24 Aug 2007 16:27:16 GMT</pubDate></item><item><title>Unique Image Query</title><link>http://www.sagewire.org/php-sql/Unique-Image-Query-1902824.aspx</link><description>Hi,

I am having trouble achieving the outcome I am looking for with a mysql 
query.

The query below pulls information from two tables: profile_images and 
name_list.

It pulls 6 random images where the name_list.id matches the 
profile_images.vref but also checks that the 'class' field from name_list is 
equal to '5'.

$index_thumbs = mysql_query(&amp;quot;SELECT DISTINCT * FROM profile_images, 
name_list
       WHERE profile_images.vref = name_list.id AND name_list.class = '5'
       OR...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Unique-Image-Query-1902824.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 24 Aug 2007 01:41:47 GMT</pubDate></item><item><title>href in mysql databse</title><link>http://www.sagewire.org/php-sql/href-in-mysql-databse-1900941.aspx</link><description>I have a html link in a mysql database field that is getting queried
using PHP. My problem is when the page is rendered, the link displays
the html not an actual clickable link. Any help'd be greatly
appreciated.

Thanks</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/href-in-mysql-databse-1900941.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 23 Aug 2007 18:03:09 GMT</pubDate></item><item><title>mySql - find and replace.</title><link>http://www.sagewire.org/php-sql/mySql-find-and-replace-1900236.aspx</link><description>Hi there.
Am a total newbie to sql language.

Does mySql have a find and replace function
or can a command be written to perform such
a task.

In the table I have a column named MEDAL_NAME

I wish to change all entries in that colum that
contain the words &amp;quot;War Plaque&amp;quot; to &amp;quot;Memorial Plaque&amp;quot;

Any pointers gratefully received</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/mySql-find-and-replace-1900236.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 21 Aug 2007 12:27:54 GMT</pubDate></item><item><title>output escaping problem</title><link>http://www.sagewire.org/php-sql/output-escaping-problem-1888024.aspx</link><description>Before I save input from a form to a database I use (after input
filtering) mysql_real_escape_string.
This means that blabla 'blabla' ...  -&amp;gt; blabbla \'blabla\' ...
To display this data from database in browser, I use stripslashes and
htmlentities.
So far so good.

But what if input is for example a location:
D:\data\folder\file.exe. Escaped this becomes D:\\data\\folder\
\file.exe
No problem here, but how can I display this in a browser again ?
Stripslashes removes \ as well as \\, s...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/output-escaping-problem-1888024.aspx</guid><author>rss@sagewire.org</author><pubDate>Thu, 16 Aug 2007 04:27:30 GMT</pubDate></item><item><title>Remote connection by proxy script.</title><link>http://www.sagewire.org/php-sql/Remote-connection-by-proxy-script-1886359.aspx</link><description>Greetings all.

I need to connect remotely to my MySQL database but
my hosting won't allow it.
I have a couple of apps - PHPmaker and DataImport
for MYsql that use a proxy php file in the root directory
on my server to 'gain' access.
Is there a generic php file that will allow access to the DB
from other applications.

Am trying to use Excel MySQL Import without success.

Thanks in advance</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Remote-connection-by-proxy-script-1886359.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 11 Aug 2007 20:18:55 GMT</pubDate></item><item><title>How can I write an SQL statement for this situation?</title><link>http://www.sagewire.org/php-sql/How-can-write-an-SQL-statement-for-this-situation-1880768.aspx</link><description>Hi,

I'm running MySQL 5.0 lon Linux.  I have two tables ...PRODUCTS
-----------------
ID  INTEGER NOT NULL
PRICE  FLOAT UNSIGNED NOT NULL
PRIMARY KEY (ID)CUSTOM_PRICES
---------------------------
ID INTEGER NOT NULL
PRODUCT_ID INTEGER NOT NULL
PRICE FLOAT UNSIGNED NOT NULL
PRIMARY KEY (ID)
FOREIGN KEY PRODUCT_ID REFERENCES PRODUCTS(ID)The table &amp;quot;CUSTOM_PRICES&amp;quot; will have a subset of products from the
products table.  What I want to do is update the price in the PRODUCTS
table with ...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/How-can-write-an-SQL-statement-for-this-situation-1880768.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 07 Aug 2007 15:53:42 GMT</pubDate></item><item><title>phpBB and access to MySQL database</title><link>http://www.sagewire.org/php-sql/phpBB-and-access-to-MySQL-database-1874512.aspx</link><description>Hello there, 
I'm here for the first time, but the matter is quite important, so I 
decided to post my question. Excuse any unprofessional language I may use.

I have on my server (nazwa.pl) a phpBB forum, but I was not its 
adminitrator. However, because of some conflict between us, I decided to 
change the password to MySQL database.

But, I actually changed my mind and still want the forum to be there, but 
with the new password.There comes the question: how to link the forum to 
th...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/phpBB-and-access-to-MySQL-database-1874512.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 03 Aug 2007 18:23:46 GMT</pubDate></item><item><title>Unable to create an additional user</title><link>http://www.sagewire.org/php-sql/Unable-to-create-an-additional-user-1870150.aspx</link><description>I am using mysql 4.1 on a windows environment, and have so far been unable
to create a user to use with a particular database, other than the root user
I have tried:

use database;
GRANT SELECT, INSERT, UPDATE, DELETE  TO 'username'@xxxxxxxxxxx'localhost' IDENTIFIED
BY 'password';

but I get a 40032 error</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Unable-to-create-an-additional-user-1870150.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 01 Aug 2007 20:06:28 GMT</pubDate></item><item><title>php mail not working on win98</title><link>http://www.sagewire.org/php-sql/php-mail-not-working-on-win98-1871363.aspx</link><description>I am getting this error on win98:

Warning: mail() [function.mail]: Failed to connect to mailserver at
&amp;quot;localhost&amp;quot; port 25, verify your &amp;quot;SMTP&amp;quot; and &amp;quot;smtp_port&amp;quot; setting in php.ini
or use ini_set() in

I have amended local  smtp host  in php.ini to that of my isp but getting
the same errors  I am using php 5, apache 2.0.59 and mysql 4.1, is there a
solution to this php mail error in windows?</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/php-mail-not-working-on-win98-1871363.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 31 Jul 2007 17:19:15 GMT</pubDate></item><item><title>Update Subquery Help</title><link>http://www.sagewire.org/php-sql/Update-Subquery-Help-1868456.aspx</link><description>Hi there. I'm in need of assistance with an update query.  I am doing
a data migration for a message board.  All went fine except some of
the mappings did not cross over.  Here is what I need to do:

Tables:
Thread: threadid, firstpostid, lastpostid
Post: postid, threadid, dateline

I need to map the first post from post.postid to thread.firstpostid
and the last post from post.postid to thread.lastpost id.

I can get these values by two queries if I know the threadid

First Post = s...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Update-Subquery-Help-1868456.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 29 Jul 2007 14:48:25 GMT</pubDate></item><item><title>MYSQL REORDER PRIMARY KEY</title><link>http://www.sagewire.org/php-sql/MYSQL-REORDER-PRIMARY-KEY-1864743.aspx</link><description>Is there a way to sort all the data in my database such as alphabetical 
or something, and then once sorted and have all the primary key's redone 
according to the sorted order? I can sort them how I want, but I do not 
know if there is a way to rename the primary id key on all the data once 
sorted.

Thanks for any help.

zach</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/MYSQL-REORDER-PRIMARY-KEY-1864743.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 25 Jul 2007 14:05:12 GMT</pubDate></item><item><title>Dropping all tables in a database?</title><link>http://www.sagewire.org/php-sql/Dropping-all-tables-in-database-1857460.aspx</link><description>Hi,

I'm using php 4.4.4 with MySQL 5.0 on Linux.  Short of dropping the
database, which my user doesn't have privileges to, what is the
simplest way to purge all data from the db?  By this I mean not only
deleting data from tables but also the tables themselves?

Thanks, - Dave</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Dropping-all-tables-in-database-1857460.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 25 Jul 2007 02:35:32 GMT</pubDate></item><item><title>Newbie question about UNIQUE MySQL v5.0.22</title><link>http://www.sagewire.org/php-sql/Newbie-question-about-UNIQUE-MySQL-v5022-1853500.aspx</link><description>Hi all,

I need some help...

My Example:

Field: Bank Account N=BA: 12353545456

Field: Bank Account N=BA:

The n=BA must be unique but could be empty also...

What is the SQL? It's Possible?Best Regards
PiRiCa</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Newbie-question-about-UNIQUE-MySQL-v5022-1853500.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 22 Jul 2007 11:04:50 GMT</pubDate></item><item><title>rename all tables in database newbie question</title><link>http://www.sagewire.org/php-sql/rename-all-tables-in-database-newbie-question-1851280.aspx</link><description>I'm not very familiar with SQL - Using mySQL 

I need to add or remove prefixes from table names - can anyone tell me 
an SQL (or PHP for that matter) way to do this please?

I can not seem to find a way to do it.

thanks

cleo</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/rename-all-tables-in-database-newbie-question-1851280.aspx</guid><author>rss@sagewire.org</author><pubDate>Wed, 18 Jul 2007 23:06:31 GMT</pubDate></item><item><title>mysql server 4.1 can not connect no matter what</title><link>http://www.sagewire.org/php-sql/mysql-server-41-can-not-connect-no-matter-what-1853348.aspx</link><description>For some strange reason mysql server 4.1 won't connect, it use to be for it
to work I had to load an init file:
 C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt

containing:

SET PASSWORD FOR 'root'@xxxxxxxxxxx'localhost' = PASSWORD('password');

and then type on my ms-dos console:

[PATH TO MYSQL BINS]/mysqld-nt --skip-grant-tables

Then open another command prompt and run 'mysql -u root' and run the
following query:UPDATE mysql.user SET Password='newpass' WHERE User='root' AN...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/mysql-server-41-can-not-connect-no-matter-what-1853348.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 17 Jul 2007 17:36:42 GMT</pubDate></item><item><title>mysql_fetch_array yielding different results to MySQL's output</title><link>http://www.sagewire.org/php-sql/mysqlfetcharray-yielding-different-results-to-MySQ-1855815.aspx</link><description>Hi,

I'm having a problem with a web app I am developing. The code in
question is:

	$sql = &amp;quot;SELECT groupID FROM memberships WHERE userID = &amp;quot;.$uid;
	$result = mysql_query($sql);
	$result = mysql_fetch_array($result);
	print_r($result);

Now, print_r($result) displays the following (when $uid = 1):

	Array ( [0] =&amp;gt; 1 [groupID] =&amp;gt; 1 )

HOWEVER, that's not what it should be. If I run the same command at
the MySQL CLI I get the following:

+---------+
| groupID |
+---------+
|   ...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/mysqlfetcharray-yielding-different-results-to-MySQ-1855815.aspx</guid><author>rss@sagewire.org</author><pubDate>Tue, 17 Jul 2007 13:30:38 GMT</pubDate></item><item><title>MySQL GROUP BY ignoring ORDER BY</title><link>http://www.sagewire.org/php-sql/MySQL-GROUP-BY-ignoring-ORDER-BY-1853121.aspx</link><description>Hi,

I am having two tables (table1, the primary table and table2 which holds 
data referring to table1) which I am trying to combine with a LEFT JOIN.

Now I'd like to retrieve all values from table1 along with the number of 
their entries in table2, sorted descending by the table2's timestamp 
however to get the &amp;quot;last&amp;quot;.

   SELECT table1.*, table2.time, COUNT(table2.t1ref)
   FROM table1
   LEFT JOIN table2 ON table2.t1ref=table1.id
   GROUP BY table1.id
   ORDER BY table2.time DE...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/MySQL-GROUP-BY-ignoring-ORDER-BY-1853121.aspx</guid><author>rss@sagewire.org</author><pubDate>Mon, 16 Jul 2007 18:46:44 GMT</pubDate></item><item><title>can not get to mysql server 4.1 directory on win98se</title><link>http://www.sagewire.org/php-sql/can-not-get-to-mysql-server-41-directory-on-1853122.aspx</link><description>I am trying to cd to my MYSQLS&amp;#172;1 directory on a win98se, but it keeps
saying invalid path

 this is what is in the path I am trying to cd to: MYSQLS~1 1     [code]&amp;lt;DIR&amp;gt;[/code]
01/11/06  13:31 MySQL Server 4.1
 C:\Program Files\MySQL&amp;gt;cd MYSQLS~1
 Invalid directory

 Trying C:\Program Files\MySQL&amp;gt;cd MySQL Server 4.1
Too many parameters - Server

I do not understand how all of a sudden it does not work anymore, the command
above has worked everytime before</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/can-not-get-to-mysql-server-41-directory-on-1853122.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 14 Jul 2007 14:01:38 GMT</pubDate></item><item><title>Newbie question about multiple databases</title><link>http://www.sagewire.org/php-sql/Newbie-question-about-multiple-databases-1852450.aspx</link><description>if I have this query:
SELECT * FROM books2006, books2007;(books 2006 and 2007 have exactly the same fields.)

how can I tell if the data was retrieved from books2006 or books2007
(whitout changing anything in the databases) ?

in other words is there any way that along the information that I 
retrieve from the fields (ex. author, date_published, isbn) that I 
also get the name of the database from which I retrieved the
information?

thank you very much,

GD</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/Newbie-question-about-multiple-databases-1852450.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 14 Jul 2007 13:33:23 GMT</pubDate></item><item><title>php 5 upgrade</title><link>http://www.sagewire.org/php-sql/php-upgrade-1846134.aspx</link><description>hi,

before I get started with my problem'd like to say thanks to all
the people who keep newsgroups going.

I am running WAMP and recently upgrading (after solving a few problems
getting the rigth php 5.dll file for apache 2.0 )

I upgraded because of the improved functionality such as the ability
to write to arrays using the foreach construct as an example. However
there are very few free information resources for these specific
updgrade problems.

Amongst the few errors I have en...</description><guid isPermaLink="true">http://www.sagewire.org/php-sql/php-upgrade-1846134.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 14 Jul 2007 08:10:04 GMT</pubDate></item></channel></rss>