|
Here is a stripped down version of what I use to authenticate users, it works fine on my php v5.0.2/mysql 4.0.21 server, but fails on my php v5.1.6/mysql v5.0.45 server.
In the code below, should I be aware of anything that might not be supported by the...
Started by Brad on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Doesn't work, try putting the following snippet right after <?php :
// Enable displaying errors.
Look into using PHP MySQL escaping .
Like that.
|
|
I've installed various PHP packages to be able to use PHP with Apache but also in the commandline. From both I need to be able to connect to MySQL databases. Pretty simple right? That's what I thought but with php-cli I receive following error:
Fatal ...
Started by Sander Versluys on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
'--with-mysql=shared,/usr'
Also check
grep extension_dir /etc/php5/cli/php.ini
Should be something like are using a module version of ....
php -i | grep mysql
The first line should contain:
Configure Command => '../configure' ...
|
|
I wan to increment a field value safely using php and mysql.
what type of table/field must I use?
is there a minimum version of MySQL I must use?
what's the sql code for this, safe transaction for MySQL?
Started by John on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
That said, there's no special PHP code, just the SQL for incrementing, then pack the above query into a ....
Field is looking like that:
UPDATE table SET field = field + 1 WHERE id = 9
About MySQL version will do (tinyint, int, float, etc).
|
Ask your Facebook Friends
|
I have two installations of mysql server 5.1.32 and 5.0.77 (same machine, os x leopard). My php mysql extension is compiled against 5.0.77 (that was the easiest thing to do, and I did it after installing 5.1.32). I'm using the 5.1.32 installation since...
Started by Vasil on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
There was an issue with MySQL user's passwords stored between a version of MySQL 4.11 and up connecting....
I would recommend looking at the MySQL's changelog from version 5.0.77 up to (and past if you have time) 5.1.32.
The two versions.
|
|
I have Ubuntu-9.04 and am using XAMPP-1.7.2 to develop a web application. The problem is that when I try to view a PHP file I wrote by visiting localhost/folder/file.php , Firefox offers me to download it instead of showing me the file as a web page. ...
Started by Shawn on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at superuser):
This means you'll have to look at the code of those pages that is killing the server... .
Try making your test look like this:
<?php $db = mysql_connect("localhost files are prompting you to save the PHP file.
Example is too minimal.
|
|
I already have the mysql database made, I just need to connect php to mysql locally but I don't know the php commands for that.
cheers
Started by Audel on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Here is one:
http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/connect....
It selects a DB
<?php mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); echo
Search for some tutorials on the subject.
|
|
I am tryng to select 5 mysql rows from the database and display them like $row[1] ect.... in php i am not sure how to do it an someone lead me down the right way please Ok i hav looked a bit more
i wanted it to come out 1 - 5 and i wanted it to display...
Started by Gully on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
And use PHP's mysql_fetch_assoc() (returnsIf you only need to select 5 rows from MySQL you can do this:
SELECT * FROM Table ORDER BY column LIMIT 5
From php.net : http://us3.php.net/....
LIMIT clause to limit your results to 5 rows.
|
|
How do I get all data from one row from mysql table exported into text files, but formatted this way:
one field under another, one per line i would like to break that data into pieces and save for example 50 lines in file1.txt then next 50 in file2.txt...
Started by Phil on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If you have a more specific problem is just too... .
Into the PHP Functions of the
PHP Filesystem Functions and PHP: MySQL Functions
There are a lot of resources in the web how to control a MySQL Database via PHP.
|
|
I have two queries, as following:
SELECT SQL_CALC_FOUND_ROWS Id, Name FROM my_table WHERE Name LIKE '%prashant%' LIMIT 0, 10; SELECT FOUND_ROWS();
I want to execute both these queries in a single attempt.
$result = mysql_query($query);
But then tell me...
Started by Prashant on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Just execute two queriesLike this:
$result1 = mysql....
So you can't do it in PHP, BUT, why%' LIMIT 0, 10;
You can't do that using the regular mysql-api in PHP.
Mysqli and PDO allow multiple queries).
For the mysql extension.
|
|
I am trying to update a record with the info from a multiple select box, I had it working fine when I was using INSERT INTO to add a new row, but now that I am trying to add it to this code that is using mysql_real_escape_string() it is returning the ...
Answer Snippets (Read the full thread at stackoverflow):
mysql_real_escape....
"' WHERE id = '".
mysql_real_escape_string(is_array($strategies) ? implode(',', $strategies) : $strategies) .
I think
$id is not string
mysql_real_escape_string($id)
It is complaining that $strategies/$id = '" .
|