Sagewire Logo

php sql RSS Feed

Recent Posts View Recent Posts | View Archived Posts

Message from Mad Hatter
Most recent post: 10/27/2007
3 authors and 3 replies.

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 timeout problem so added
set_time_limit(0); but still no joy. As I said, all the scripts I have tried
work fine on small databases but die on the large database. Can anyone shed
some light on where I'm going wrong? read more about Advice wanted on backing up large databases


Message from Tine
Most recent post: 10/22/2007
2 authors and 3 replies.

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 delete it to my script can
geocode the adresses without problem. I could do it manually but the
database has about 600 post. Can someone help with the code to use, please?

It look like this in phpadmin [screencast.com] and it should looke like this
[screencast.com]

/Tine read more about How to delete \r\n after using Navicat in phpmyadmin/Navicat?


Message from news.telepac.pt
Most recent post: 10/20/2007
2 authors and 2 replies.

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 your query closely, and check that the quotes are correct and not
mis-matched. Other possible failure causes may be that you are uploading a
file with binary outside of a quoted text area. You can also try your query
on the MySQL command line interface. The MySQL server error output below, if
there is any, may also help you in diagnosing the problem. If you still have
problems or if the parser fails where the command line interface succeeds,
please reduce your SQL query input to the single query that causes problems,
and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNp1kj1v2zAQhnf+ihsKeJEUkjL1tTmGm6aVbcVKXSBLcbZkh4EsuvoIkv60/qMOnbp16tEfbYKi
k/Qej/c+vLvJYjFfJDAWMJaQTmYJhDFEHIJYsfyWTn7VhWkZGy/zBN5cFwm0X6o9Nm3ZeJVeefv7
vfMI0huGIDkPLri4ECGIMOEy8Tmsn1em+9ztYPK0hzds+pzfpAkMPeFJ7u7wya3Mln3MFzDPHRhd
TWa3DiwnZPtJ1zCd312n6QiUx1k2HSVkE3ncEyx7l9ksZ57bWr4nBKS67p9YOppdJVDWbt9t3Igd
zAZi4Ayyn48GoTCwxOar3lFk0SNMse7LCt6b9jtMTVPqBlnab7GBAlvIyqKhz read more about problems importing tables


Message from Brian
Most recent post: 10/15/2007
7 authors and 8 replies.

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 "orders" and "productslist" The orders table has
7000000 (yes that is 6 million) records and the productslist has 6000, all
search fields have been indexed, the whole DB have 25 tables
The users select the search criteria, summits the form and the below PHP
code it run , it can take upwards of 20 mins to return the results. So my
question is, is there anything wrong with my code or the way I and running
this, or have I just hit the limit of MySQL
Many thanks
Brian$query = "SELECT p.prod_code, p.description, SUM(o.`ord` ) AS totalor,
SUM(o.`del` ) AS totaldel, SUM(o.`total_cost_price`) AS totalcostprice,
SUM(o.`total_invoice_price`) AS totalinvoiceprice FROM productslist AS p
LEFT OUTER JOIN orders AS o ON ( p.prod_code = o.prod_code AND o.timestamp
>= $sdate AND o.timestamp <= $edate AND o.status <> "p" AND (status NOT IN
("u")) AND (status NOT IN ("n")) ) GROUP BY p.prod_code ORDER BY
p.prod_code";
$result = mysql_query($query,$db) or die (" read more about Slow results


Message from Mad Hatter
Most recent post: 10/12/2007
3 authors and 8 replies.

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? read more about What's wrong with this?


Message from MattMika
Most recent post: 10/4/2007
3 authors and 4 replies.

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 "INSERT IGNORE" how do I track the occurence of an ignore?

I'd like to print a message saying something like "X email addresses
were duplicates and weren't inserted into the DB."

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 read more about Ignore track?


Message from Anze
Most recent post: 10/3/2007
3 authors and 4 replies.

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 source and one
for the destination server? They have access to files and DB data we wish
to move, so we should just specify the connection details and they could
interoperate to move the data from source to destination.

I hear you say: "what about time limit, memory limit,...?" The work could be
split into tiny pieces - the destination script could be called
continuously until the work is done. Actually, you could point a browser to
the destination script and it'd request another tiny piece from source
and use it. Then it'd display HTML with JAVAScript redirect to itself
(unless the work was done of course). You just have to wait, but who
cares - it'd take a lot less of my bandwidth and'd probably be
faster too.

Now the question is: is there something like this out there? :)
I have searched through google but could not find anything.

Thanks,

Anze read more about import / export between servers


Message from JSOUL Rocks
Most recent post: 10/2/2007
3 authors and 3 replies.

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, xbox1, 4432
Mexico, sony, playstation2, 4545

etc.

The tables I have are as follows and the problem is that I could
reference 2 tables but not 3. The challenge is that the reference
between:

(1) members and countries tables (countrynum and countryname)
(2) members and consoles tables (consolemodelid = consoleid)
(3) consoles and consolebrands tables (consolebrandid = brandsid)

and then each ID has to do a lookup to return the name associated with
the ID, the console model to consoleid, the brandsname to the
brandsid, and the countryname to the countryid.

members table
userid
username
countrynum
consolemodelid

consoles table
consoleid
consolemodel
consolebrandid

countries table
countryid
countryname

consolebrands table
brandsid
brandsname

Right now I have been working with this query but I'm can not handle all
these tables since there are now three cross referenced instead of
just two:

SELECT consolebrands.brandsname, members.consolemo read more about Count across 3 tables


Message from filipwitczak
Most recent post: 10/1/2007
2 authors and 2 replies.

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]&[50!15]|62=[49!130]&[50!15]|
where each |client.id=[option.id!value]&[option.id!value]|

the problem is that I need to secect specific reservation which
contains a client's data within one select statement.

So, I thought that it'll be like

select * from reservations,clients where reservations.clients like
'%|' + client.id +'='

but I don't know sql so good to solve the probem and I don't know
how to google it (my native language is polish so every query I did to
google gave me carp results)I'd be grateful for any help.

regards
Filip W. read more about How to select fields form two tables, where one is containing some text+field form other table+some text


Message from tom
Most recent post: 9/27/2007
2 authors and 2 replies.

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. read more about Whats the most portable way to identify field existence?


Message from blackrosezy
Most recent post: 9/26/2007
3 authors and 3 replies.

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:
"This is my very very large paragraph"

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',..

Is there any better to workaround this problem? read more about Compare every word in paragraph with every row in database


Message from stevenleongusa
Most recent post: 9/21/2007
2 authors and 2 replies.

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 in each employee's department who are paid more than
their manager.
All employees (including managers) appear in this table.
Each employee has a manager (except the CEO), and the mgrid in the
employee's row is the empid of the employee's manager. read more about SQL question and query result


Message from news.prolog.net
Most recent post: 9/20/2007
2 authors and 2 replies.

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 read more about help with db_host


Message from miso
Most recent post: 9/16/2007
2 authors and 3 replies.

I have problem with my php/sql code because id (auto inc., primary) row.
(
$sql = "INSERT INTO ".$_CONF['tprefix']."schedule_scores VALUES ";
$sql .= "('NULL','$newdate','$newtime','$newlocation','$team1_id',";
$sql .=
"'$team2_id','$team1_div','$team2_div','$newteam1_score','$newteam2_score',";
$sql .= "'$newseason','','','','','','1')";

)

this is code and I done this

(
$sql = "INSERT INTO ".$_CONF['tprefix']."schedule_scores (date, time,
location,
team1, team2, team1_div, team2_div, team1_score, team2_score, season,
summary,
pic_name, pic_caption, tourneyid, tourneygid, standings) VALUES ";
$sql .= "('$newdate','$newtime','$newlocation','$team1_id',";
$sql .=
"'$team2_id','$team1_div','$team2_div','$newteam1_score','$newteam2_score',";
$sql .= "'$newseason','','','','','','1')";
)

because I know that I have to avoid id row to get it work.

please help
Miso read more about php5 mysql5.0 win problems


Message from Jannis
Most recent post: 9/16/2007
2 authors and 2 replies.

Some of my php files start with <?php session_start(); ?>
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() [<a
href='function.session-start'>
function.session-start</a>]: Failed to
initialize storage module: files (path: ) in (..path..)/starttest.php
on line 1.

It does not matter whether I use notepad or some editor, or copy a file
from php.net . Actually the example here mentioned was written in
notepad.

Is this a bug? Do I overlook something? What can be wrong? read more about session_start problem in php5


Message from Pugi!
Most recent post: 9/14/2007
2 authors and 2 replies.

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 -> I want this to result in an error

Pugi! read more about Unique constraint for the columns doesn't work when one of values is null.


Message from Eddie
Most recent post: 9/13/2007
2 authors and 2 replies.

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 change the data already stored in Microsoft SQL. I can only
read it, and IT won't let me change it. (Gotta love corporate
America, but I digress). So now that the data is there, how can I
retrieve it when it has a single quote in the data? Am I missing
something? Please help.

=====
Query sample:

$query1 = "SELECT * FROM table WHERE Name = '" .
addslashes($name) ."' ";
$result1 = db_query($query1, $DBLink) or die ('Error: Database
error !');
while ($row1 = db_fetch_assoc($result1)) {
echo ( ($k++ == 0) ? (stripslashes($row1['WCUSNO'])) :
("," . stripslashes_mssql($row1['WCUSNO'])) );
}

=====
Data sample (Name):

John Doe
John Q Public
Tom's Bait Shop <---- This is where it dies, due to the
apostrophe / single quote

Thanks for your help.

Eddie read more about Problem Getting MS SQL Data With Single Quotes


Message from Rob
Most recent post: 9/13/2007
2 authors and 2 replies.

Hi,

I am having a problem with a search. Below is the code:

$colname_rs_product = "-1";
if (isset($_GET['search'])) {
$colname_rs_product = (get_magic_quotes_gpc()) ? $_GET['search'] :
addslashes($_GET['search']);
}
$colname2_rs_product = "-1";
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("SELECT * FROM tblProducts WHERE strModel
LIKE %s% or strDescription LIKE %s%", GetSQLValueString
($colname_rs_product, "text"),GetSQLValueString($colname2_rs_product,
"text"));
$rs_product = mysql_query($query_rs_product, $conn_nav) or die
(mysql_error());
$row_rs_product = mysql_fetch_assoc($rs_product);
$totalRows_rs_product = mysql_num_rows($rs_product);

So this is what is happening. I have a form on a page with a text box
named search. I am using that text box for the parameter that I want to
search on. The parameter is grabbed by the function GetSQLValueString,
(see code below)

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) :
$theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text": read more about SQL Query Problem


Message from Cindy Chambers
Most recent post: 9/13/2007
5 authors and 6 replies.

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 happens.

So I know the code works from my local test so why does it not work when I
put it live? All this code worked prior to my ISP upgrading their MySQL and
phpMyAdmin software. Any ideas how to get everybody to talk again?

Here are some stats:

My ISP:
localhost
a.. Server version: 4.1.22-standard
b.. Protocol version: 10
c.. Server: Localhost via UNIX socket
d.. MySQL charset: UTF-8 Unicode (utf8)
e..
MySQL connection collation: utf8_unicode_ci

phpMyAdmin - 2.10.0.2
a.. MySQL client version: 4.1.22
b.. Used PHP extensions: mysql

My Developer Server:
Apache2Triad which includes Apache server, MySQL and PHP and is Windows
based.
Updates and versions for this Triad include:
fixed mod_perl 2.0.1 bug *
added apache SSL restart
optimised access.cgi to deal with huge logs
updated Apache to 2.2.0
updated OpenSSL to 0.9.8a
updated PHP to 5.1.2
updated Zend Optimizer to 2.6.2
updated Xdebug to 2.0.0 beta5
updated DBG to 2.18.5
updated S read more about Counting problem with Query


Message from Blue_Hatter
Most recent post: 9/9/2007
3 authors and 3 replies.

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 read more about Learning MySQL


Message from GD
Most recent post: 9/9/2007
2 authors and 2 replies.

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:

<?php
include 'config.php';
include 'opendb.php';

$query = "SELECT * FROM information ORDER BY lastname";
$result = mysql_query($query) or die('Error, query failed');

$tsv = array();
$html = array();
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$tsv[] = implode("\t", $row);
$html[] = "<tr>
<td>" .implode("</td><td>", $row) . "</td></tr>";
}

$tsv = implode("\r\n", $tsv);
$html = "<table>" . implode("\r\n", $html) . "</table>";

$fileName = 'mysql-to-excel.xls';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$fileName");

echo $tsv;
//echo $html;

include 'closedb.php';
?>thank you very much,
GD read more about problem saving an excel file


Message from mbarbs
Most recent post: 9/9/2007
4 authors and 4 replies.

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 "No search results" text on the last line. Any help
would be greatly appreciated.

<?php

$searchTerms = $_POST['search_term']; $searchSection =
$_POST['search_type'];

if($searchSection == 1) {

require_once 'db_connector.php';

$connector = new DB_Connector();

$result = $connector ->
query("SELECT * FROM 1_questions WHERE
question LIKE '%$searchTerms%'");

echo '<span class="title">Search Results</span>';
echo '<div class="title_rule"></div>';

while($row = $connector -> fetchArray($result)) {

echo '<div class="question">'.$row['question'].'</div>';
echo nl2br('<div class="answer">'.$row['answer'].'</div>');
echo '<br />';

} }

elseif($searchSection == 2) {

require_once 'db_connector.php';

$connector = new DB_Connector();

$result = $connector -> query("SELECT * FROM 2_questions WHERE
question LIKE '%$searchTerms%'");

echo '<span class="title">Search Results</span>';
echo '<div class="title_rule"></div>';

while($row = $connector -> fetchArray($result)) {

echo '<div class="que read more about search script problem


Message from Matthew White
Most recent post: 9/6/2007
5 authors and 13 replies.

I have started using the new mysql_* extensions. Here is the code I am
trying to run:
$temp2 = "SELECT * FROM assignments2 WHERE daydue < '247' && progress !=
'100'";
$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 "<" to "<=" does the script work. Why does not the less than operator
work? read more about Error with < in SQL


Message from Joe
Most recent post: 9/4/2007
2 authors and 2 replies.

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. read more about ADOdb w/MySQL


Message from Tony Peardon
Most recent post: 9/2/2007
2 authors and 2 replies.

Hi all,
I have got a php function which asks mysql the following question...

"select * from data where id='$id' and parent='$parent' and node='$node'"

Now, I do not need to "select *", 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. read more about simple query question


Message from goodmann
Most recent post: 8/30/2007
2 authors and 2 replies.

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 = "mysql"; ##Defines Database type
$dbhost = "207.36.15.13:3306"; ##Your host
$dbuname = "maincontheaderbox"; ##Database Name
$dbpasswd = "bobyken"; ##Database Password
$dbase = "z_extras";
maincontheaderbox is the root user getting all previleges.

Comment : I mentioned PORT 3306. Not sure at all of that port (from
OVH french.hosting services)

2) my.cnf

I ensured that my.cnf doesn't forbid outside mysql connections.
skip-networking.
http://guides.ovh.com/ConnexionDistanteMySQL

3) Doc
- http://forum.ovh.com/archive/index.php/t-5716.html
- http://fr.php.net/mysql_connect

http://drupal.org/node/55108
$db_url = 'mysql://My_Account_Name(A)_username:password@xxxxxxxxxxx/
My_Account_Name(A)_databaseName';

Many thanks for your help from your knowledge and experience.

Bob read more about Probleme mysql_connect : Connaissez ?


Message from goodmann
Most recent post: 8/30/2007
2 authors and 2 replies.

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 = "mysql"; ##Defines Database type
$dbhost = "207.36.15.13:3306"; ##Your host
$dbuname = "maincontheaderbox"; ##Database Name
$dbpasswd = "bobyken"; ##Database Password
$dbase = "z_extras";
maincontheaderbox is the root user getting all previleges.

Comment : I mentioned PORT 3306. Not sure at all of that port (from
OVH french.hosting services)

2) my.cnf MYSQL

I ensured that my.cnf doesn't forbid outside mysql connections.
skip-networking.
http://guides.ovh.com/ConnexionDistanteMySQL

3) Doc
- http://forum.ovh.com/archive/index.php/t-5716.html
- http://fr.php.net/mysql_connect

http://drupal.org/node/55108
$db_url = 'mysql://My_Account_Name(A)_username:password@xxxxxxxxxxx/
My_Account_Name(A)_databaseName';

Many thanks for your help from your knowledge and experience.Bob read more about mysql_connect : Here OUTSIDE connection.


Message from SteveK
Most recent post: 8/28/2007
2 authors and 2 replies.

Hi,

Does anyone know how to query a varchar field to bring back any records
containing an acute-e - that's the "é"

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 read more about Finding Acute-e


Message from MattMika
Most recent post: 8/24/2007
4 authors and 8 replies.

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.

Theres got to be a better solution to avoid having two date fields in
my db. Any suggestions?

TIA
Matt Mika read more about Format datetime with query?


Message from Richard
Most recent post: 8/24/2007
2 authors and 2 replies.

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 < 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. If I enter html code into a LONGTEXT field which is a
URL hotlink, does it show the link in the results as a clickable
hyperlink or does it show the HTML code as simple characters?

i.e. does it show: <a href="gohere.com/page1.html">
GO HERE</a>
or does it correctly show GO HERE , clickable and hot

2. What are the pro's and con's of storing jpeg, gif images
within the table as binaries.

Many thanks read more about MAXIMUM LENGTH OF LONGTEXT FIELD


Message from Steve
Most recent post: 8/23/2007
2 authors and 3 replies.

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("SELECT DISTINCT * FROM profile_images,
name_list
WHERE profile_images.vref = name_list.id AND name_list.class = '5'
ORDER BY RAND() LIMIT 0,6");This is working fine for pulling 6 random images that meet those
requirements but I'd also like to to make the profile_images.vref /
name_list.id UNIQUE as there are multiple images for each each
name_list.id - So therefore I'd like to return 6 unique images from 6
id's in the name_list rather than having cases where multiple images show up
from one name_list.id

I'm hoping this is going to be a simple adjustment to someone who knows what
they're doing :)

Thanks in advance.

Steve read more about Unique Image Query


Message from Matt Barbadian
Most recent post: 8/23/2007
7 authors and 10 replies.

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 read more about href in mysql databse


Message from Richard
Most recent post: 8/21/2007
3 authors and 5 replies.

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 "War Plaque" to "Memorial Plaque"

Any pointers gratefully received read more about mySql - find and replace.


Message from Pugi!
Most recent post: 8/16/2007
4 authors and 6 replies.

Before I save input from a form to a database I use (after input
filtering) mysql_real_escape_string.
This means that blabla 'blabla' ... -> 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 \\, so I am left with
D:datafolderfile.exe This isn't what I want, I want it to show D:\data
\folder\file.exe.Pugi! read more about output escaping problem


Message from Richard
Most recent post: 8/11/2007
2 authors and 2 replies.

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 read more about Remote connection by proxy script.


Message from laredotornado
Most recent post: 8/7/2007
2 authors and 2 replies.

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 "CUSTOM_PRICES" will have a subset of products from the
products table. What I want to do is update the price in the PRODUCTS
table with the corresponding entry from the CUSTOM_PRICES table,
assuming there is one. If there isn't a corresponding entry in the
CUSTOM_PRICES table, I'd like the price value in the PRODUCTS
table to remain unchanged.How can I do this in a single UPDATE statement?Thanks, - Dave read more about How can I write an SQL statement for this situation?


Message from Felinity
Most recent post: 8/3/2007
2 authors and 3 replies.

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
the database with the new password? I have access to the forum files, the
database administration panel - but how to do it?

Please help - now I feel I'd overreacted with this forum.

Best regards,
Fel--
http://felinity.jogger.pl/

--
http://felinity.jogger.pl/ read more about phpBB and access to MySQL database


Message from Nospam
Most recent post: 8/1/2007
3 authors and 3 replies.

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 read more about Unable to create an additional user


Message from Nospam
Most recent post: 7/31/2007
3 authors and 3 replies.

I am getting this error on win98:

Warning: mail() [function.mail]: Failed to connect to mailserver at
"localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
or use ini_set() in

I have amende