MySQL Transactional Examples
Does anyone have any examples of using Transactional processing of
MySQL with PHP? I'm not sure if the BEGIN statement needs to be in
front of my SELECT statement or processed before hand by itself.
View Complete Forum Thread with Replies
Related Forum Messages:
Looking For Examples Of Huge MySQL & PHP
Does anyone know of any existing operational web sites where a massive (ie. millions of records) MySQL database combines with PHP to provide a directory service? I'm thinking along the lines of the White or Yellow Pages or similar. I ask because I'm researching a project which provides a (large) web-based specialist directory service, and I'd like to be in contact with people who've already done it with MySQL and PHP. I use MySQL and PHP all the time for small applications, but I'm not sure how they compare (in terms of speed and reliability) in the commercial world against the expensive alternatives.
View Replies !
Real Life Examples Of Mysql+session_set_save_handler
In my test setup using my own session handlers with session_set_save_handler and mysql, the session handler opens and close mysql connections. But what if my page also requires some mysql queries? Should I open a new connection or use the already opened one (opened by the session handler)? I have made it a good practice to close a connection after a query but if I do it with only connection open no session data will be written to my mysql table. I have seen some scripts using persistent connections but are not sure what would be the best for a real world environment.
View Replies !
GD Module Examples
Anyone here used, or is using PHP's GD module in their web design? I would be real interested in seeing what anyone has done with it on their web site with perhaps some sample code which demonstrates how they did it.
View Replies !
E-Mailing Examples Help.
I have created a form, which will allow a person to upload a picture, and leave me mail. What I am having problems doing is, having the form actually upload the picture and attach it to an email that is then sent to me. If anyone knows of any sample code I could look at,
View Replies !
Pagination Examples
Basically im asking if anybody knows of any example code or tutorials where i can learn how to paginate a PHP page. I have a mySQL news table which holds stories as mark up. Ive had a look at a few examples and tutroials but most seem to have the the pages of the story in seperate rows in the database. Im also just confusing my self now with the multitude of options. Im using e107 as the back end by the way.
View Replies !
Printing Examples
Does anyone have any examples of how to send web page content to the printer? I've looked at the PHP manual and I think I know how to do it but I'd like be sure: I have to open the printer first Then I use the print write call? Then I close the printer
View Replies !
Examples Of Using Inherance And Interfaces In PHP 5
As many of you knows, Zend has relased the Beta version of PHP 5. I have allready make some tests of interfaces, classes inherance, static and public variables, etc, and everything looks ok. Now, when you work with PHP the most common thing is to do something with databases, you have somehow the "same kind of pattern" like: logins, update, add, delete data from de db, show data and that is it. Now, I will like to use the new PHP 5 features in my next project. I was trying to desing some clases and inferfaces for the "pattern" that PHP use to have, and have not come with any good worthy idea. I know Java too, so I was very happy about the the new features in PHP5 and looking to use object model features. Im looking for very clear examples on, how you have used the new features in PHP5 to do the "old PHP thing"?
View Replies !
PHP Tutorial Or Project Examples
I've worked with ASP, ASP.NET and WebSpeed in the past, but now I'd like to learn PHP. I've already gotten a Fedora web server up and running with Apache and MySQL. I'm looking for some examples - or even better a free project - to look over and see how other are using PHP to read/write records to and from MySQL. I'm trying to create a very simple web based contact management system that will store data in a couple of tables. Can someone recommend any examples or web sites to refer to? I'm about to dive into the PHP manual, but I'd like some other material to study as well.
View Replies !
Printing Code Examples
I am building a tutorial site, all is working apart from 1 thing. If i type in some php code even basic stuff like <?php echo date ('Y'); ?> then when its submitted into the database the php gets stripped away i'm using the tinymce editor if that helps make it clear. I need to be able to show code examples as my tutorials are for web design does anyone know a way of showing code. I can disable the tinycme editor and type code right into the textfeild and use the html safe values like: <?php echo date ('Y'); ?> but thats not a good solution as i want to use the tinymce editor as my members will be able to write some tutorials.
View Replies !
Pointer Examples Of Cleaning
I have managed to create a very basic CMS, the CMS cover 6 pages and each page can have its title, pagetext, image link 1 and 2 altered. I have doen the best I can but, I imagine that the code I have produced is somewhat ugly and could be clearer and slimlined. I have included the code for both the form page and the post page. Code:
View Replies !
Examples Of Autoloading Object
I'm a bit confused with autoloading objects. This is only for PHP5, correct? All autoloading functions start with "__" correct? And can someone give me a easy to understand example of an autoloading object? I googled, but I still have questions about it.
View Replies !
Examples Of Well Written Large PHP Projects
To improve my PHP I've decided to study the source code of a medium to large open source PHP application. Can anyone recommend any applications that they would consider prime examples of well written PHP? The sort of attributes I'm interested in are basically just good software engineering such as clean internals, being well designed, good use of abstraction and also perhaps being well tested (things where there is a lot of room for improvement in my code ).
View Replies !
Looking For Recent Visitor Code Examples/ideas
I am working on updating my content management page and wanted to overhaul my "recent visitor" code. The code that tracks who has been and is still on my pages. I have not been able to find some examples I saw here a few months ago and was wondering if anyone could point me to some examples. The more versatile the better.
View Replies !
File Upload :: Good Working Examples?
I want to make a file upload using php, but everytime i get an error "File name not given". Any hints why this is happening? I used a sample from php.net, and other php sites, but all samples are basically the same. Maybe someone from you has a good and working example?
View Replies !
PHP And MySQL: How To Properly Call A Stored Procedure With Output Parameters From PHP - Mysql, Mysqli, Or PDO
I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a hell of a time with it... The following comes from phpinfo(): PHP Version: 5.1.2 mysql Client API version: 5.0.18 mysqli Client API version: 5.0.18 PDO Driver for MySQL, client library version: 5.0.18 MySQL version, from running SELECT version(); = 5.0.18 Here's the procedure I've created in MySQL: CREATE PROCEDURE testproc(OUT p_testvar varchar(50)) BEGIN SET p_testvar = 'HELLO WORLD!' END [color=blue] >From the MySQL Command Line, I can do the following:[/color] mysql> call testproc(@a); Query OK, 0 rows affected (0.00 sec) mysql> select @a; +--------------+ | @a | +--------------+ | HELLO WORLD! | +--------------+ 1 row in set (0.00 sec)
View Replies !
Warning: Mysql_connect() [function.mysql-connect]: Lost Connection To MySQL Server
I've set up a test server on an Ubuntu system. I installed and configured Apache, PHP and MySQL however, whenever I try to connect to a MySQL database I get this error: PHP Code: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/index.php on line 8 Lost connection to MySQL server at 'reading initial communication packet', system error: 111 Does anyone know what is causing this and how I can solve the problem?
View Replies !
Create A Multi Table Database In MySQL And Write To And Retrieve Information Using MySQL.
I am trying to create a multi table database in MySQL and write to and retrieve information using MySQL. I am able to insert and call data easily enough going into one table, but I am having problems with connecting tables and using the idea of normalization. I am starting simple with an online registration for alumni of an association. My first table in a database is called alumni and it stores there e-mail address, first and last name and year of graduation. Code:
View Replies !
MySQL Error - Supplied Argument Is Not A Valid MySQL-Link Resource
I am getting the error Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/server7/public_html/71/arranholloway/database4.php on line 7 I tested my code on local computer and there were no problems, the error message only appeared when I loaded it onto my web hosters server. I'm new to PHP so its probably something simple but any help would be appreciated.
View Replies !
Connection With MySQL. Navicat - CANNOT CONNECT TO MYSQL SERVER ON LOCALHOST
I am new in PHP & MYSQL. I installed PHP & MYSQL properly. To easy operate for MYSQL I installed Navicat and it installed properly. But when I am going to test the connection between MYSQL & Navicate the error message showing CANNOT CONNECT TO MYSQL SERVER ON LOCALHOST (10022) it should mention that my connection name = localhost, Ip = localhost,port = 3306 , user name = root in Navicat.
View Replies !
PHP Saying Error In Mysql Syntax, But Written My Mysql Query Browser!
I have a basic db that I access with MySQL query browser. Everything seems fine to me but I am using this db as part of a php shopping basket and when I try to add an item I get: Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>function.extract]: First argument should be an array in functions.inc.php on line 31 Notice: Undefined variable: price in functions.inc.php on line 36 Notice: Undefined variable: price in functions.inc.php on line 39 Notice: Undefined variable: total in unctions.inc.php on line 39 I'm assuming the last three are caused by this problem as price should be passed to the cart, and total is worked out using it. However although I know mySQL code it was the MySQL query browser that actually generated the code and I cannot see a way to view or debug the code. The db has one table in it which is made up of id, name, subname, desc, and price. The code in the php file that is being referred to is:
View Replies !
MySQL Pro Certified Server Versus MySQL Community Edition
Does anyone have any experience with this? I'm trying to see if the service provided with the "MySQL Network with MySQL Pro Certified Server" version is worth the costs involved. I'm making a real estate website that's basically going to be a listing service. You can do searches on the listings for free, and it costs to add your listing. Our listings are only going to be active for 30 days, and we really don't expect to have more than maybe a thousand or so listings at a time tops. I'm just wondering if this is something that should be manageable for me, even though I really don't have any prior DBA experience. I've played around with phpMyAdmin for a bit, so I know how to backup/replace/repair/etc., and am just wondering if this is enough. Any thoughts?
View Replies !
Automatic Scheduled MySQL Backup (MySQL Dump)
Is it possible to configure a UNIX/LINUX server to do a MySQL Dump for a database on an automatic schedule and then to email the dump file to me (the administrator)? I want to be able to have my database automatically backed up every week and emailed to me for storage purposes without any action on my part.
View Replies !
PHP/MySQL: Using PHP To Probe MySQL Db And Send An Email Automatically
Let's say you have a login feature on your site... and a user forgets their password which is stored along side their email address in a MySQL database. Is it possible to use PHP to automatically send the password to that email address upon request? If so, please provide a detailed solution. If not, can Java be used in some way to accomplish this?
View Replies !
--with-mysql ? Php-4.4.2 With Mysql Install In Special Directory
I'm trying to link php-4.4.2 with mysql install in special directory, like /usr/newsystem/mysql, but whatever options I try, php always gets linked to version in /usr/local/lib. I've tried several options: --with-mysql=/usr/newsystem/mysql --with-mysql-dir=/usr/newsystem/mysql --with-mysql-lib=/usr/newsystem/mysql --with-mysql-lib-dir=/usr/newsystem/mysql ....but none of them work, CLI is always build against /usr/local/lib/ libraries.
View Replies !
Create A Sequence In MySQL, With Mysql Variable?
This might be fairly easy to do and I think I've seen the code before, but I haven't seen many good examples of this. Of course Pear::DB probably uses this code in some of its API, probably in dealing with auto-increment indexes and prepared statements. Maybe I'm off base here, but I'm looking for something like this: (psuedo-code) Of course the seq table only needs 1 row holding id, which is updated. select id from tbl; // get result resouce and do fetch, store value in $myid set @myvar = $myid + 1; // can php send to MySQL with a query? ( never seen this ) update myseq set id=@myvar // send this statement through in a update/query // for use in PHP code $newSeqVal = $myid +1
View Replies !
And Mysql - Connect Remotely To A Mysql Database.
I am trying to connect remotely to a mysql database. here is the code: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_myDB = "http://db195.perfora.net"; $database_myDB = "dbname"; $username_myDB = "username"; $password_myDB = "password"; $myDB = mysql_pconnect($hostname_myDB, $username_myDB, $password_myDB) or trigger_error(mysql_error(),E_USER_ERROR); ?> here is the error: Warning: mysql_pconnect(): Unknown MySQL Server Host 'db195.perfora.net' (1) in /oldhome/WWW/wingsofthedawn.org/htdocs/final/Connections/myDB.php on line 9
View Replies !
Copy And Paste On MySQL To MySQL Database
Would there be any issues if i literary Copy and Paste a mysql db from one server to another mysql db server? When i say "copy and paste" is just like tranferring one word doc from one pc to another pc. I tried the copy and paste already and the new server had recognize the DB i had pasted. I just want to confirm if there would be issues doing it so.. Or should i use Mysql.com Migration toolkit?
View Replies !
Mysql Update - Grab The Value Count From Mysql
I'm trying to grab the value count from mysql and add one to it. This is very simple, but I"m still completely lost! here is the code: require("connect.php"); $result = mysql_query("SELECT fav_count FROM favs WHERE page_id = $page"); $result++; mysql_query("UPDATE favs SET fav_count = $result WHERE page_id = $page"); echo "Thank you for telling us you like this!<br />Please wait..."; echo "<META HTTP-EQUIV=Refresh CONTENT="2; URL=link.php">"; Any help is greatly appreciated!
View Replies !
Php/Mysql- Uploading Mysql Database
I've set up a basic database using Mysql (just creating a web blog I followed a tutorial) and then started writing the php code for interacting with the database. how do I put the Mysql database onto the the web server where I have server space (the server I use is just some company that I pay €100 a year for). I need the php file to get the data from the Mysql database...
View Replies !
Problem Getting PHP To Recognize MySQL, Using PHP 4.3.7 And MySQL 4.0.20
I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the mysqld daemon up and running. But when I look at the output of phpinfo() , I do not see it there, which is worrisome and so I tried to recompile PHP and do ./configure with the --with-mysql=path but I don't really know where my mysql's header files should be , is there any way to find that out by using any of the mysql commands? I did try to do ./configure for PHP4 without any parameters and when I looked at the output, I do see that PHP seems to recognize that mySQL is there : .... checking for MSSQL support via FreeTDS... no checking for MySQL support... yes checking for specified location of the MySQL UNIX socket... no checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock checking for inline... (cached) inline ..... Hence, why is that when I do phpinfo() , mySQL still doesn't show up? I suspect that mysql isn't working correctly with php, because if I use the mysql_connect() function in my php, I get the error "Fatal error: Call to undefined function: mysql_connect() " and yet it DOES seem like PHP recognizes mysql is there. That "unable to recognize mysql_connect function" error comes up after installing PHP using ./configure with or without any parameters.
View Replies !
Seeking Resources On Mysql, Not Mysql.com
I'm looking for some resources that can aid me in getting deeper into php/mysql. I am presently looking at a syntax that lets me check a mysql row for one particular value, using sql. Then I look for a sql based solution to get a column name based on the above value. Last I need to update that row, actually NULL that particular field in that particular row. I've been reading mysql.com the function list all afternoon, nothing found that might make it able for me to write those statements in question. So now I better expand and seek new sources, google.com didn't give me much while searching the groups.
View Replies !
Migrate Old Mysql DB To New Mysql Server
I am trying to migrate our old mysql DB to another new mysql server using AB: MySQL Migration Tool. The migration has some problem. One of the tables from the old DB had a column defined Datatype as DATE. However, when I do migration. The migration informs me that " The following error occured while transfering data from log Cannot convert value '0000-00-00' from column 13 to TIMESTAMP." I believe the migration forces to convert the datatype into timestamp. The work around i can do on this is to change the datatype of the column on the old DB into Timestamp. However, I don't want that. I want to retain the DATE datatype.
View Replies !
Mysql 3.5 And Mysql 4.1 Data Insert
I am not able to insert data in mysql 4.1 by using same php script i used for mysql 3.5 . only id field and date field which are not VARCHAR get inserted but not VARCHAR PLease help here is my insert statement Code:
View Replies !
Socket '/var/db/mysql/mysql.sock' (2)
I'm just uploading a site to a new hosting company, and i get this error socket '/var/db/mysql/mysql.sock' (2) I know my script is sound as it runs fine local and on my usual server, from googling it, it appears that it may be an problem server side, can anyone help?
View Replies !
5 / MySQL Connect - '/tmp/mysql.sock'
I've installed php5 and phpMyAdmin (MySQL) via synaptics. Both seem to work fine on their own, but when running a php mysql_connect I get a socket error (see below). I have included as much information as think will be relevent. Code:
View Replies !
Could Not Connect To MySQL: Can't Connect To Local MySQL Server Through Socket
To connect to a MySQL database, hosted on my machine, an iMAC G5 with OS 10.4, I am using the following code: $dbc = mysql_connect ('localhost', 'guestuser', �') OR die ('Could not connect to MySQL: '.mysql_error() ); However, I receive an error message: Could not connect to MySQL: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2). MySQL server is running, and user name/password are valid.
View Replies !
Connect To MySQL - Can't Connect To Local MySQL Server Through Socket
I've finished coding php, run it localhost and uploaded to my Apache server with Linux OS. However, I'm seemingly unable to connect to mysql at the server side. and received the following message: Could not connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock'(111) What's this message abt? I tried to get into MySQL without php on the server. and received the same message at the console.
View Replies !
Your MySQL Library Version 5.0.37 Differs From Your MySQL Server Version 5.0.45
well i got phpmyadmin loaded and now when i go to the home page i get these two errors and can't seem to find what causes them. Your PHP MySQL library version 5.0.37 differs from your MySQL server version 5.0.45. This may cause unpredictable behavior The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
View Replies !
MySQL? XML? XML And MySQL? SQLite?!
I've been using PHP for a while now and I'm beginning to migrate to PHP5. So far, I'm impressed. I need to develop an admin application to enable users to update a website that is built on a MySQL database. In most cases, I'd simply develop an application to manipulate the database but as the website is updated fairly infrequently, I am considering a number of further options instead to alleviate server load. I am considering retaining the MySQL database for structure and building scripts to generate XML from the data that can be processed and transformed server-side (XSLT). Another option is SQLite. And yet another approach is to generate static HTML pages from the database when it needs to be updated or published.
View Replies !
MYSQL To MYSQL Transfer
I've got a MYSQL Database, essentially I plan on having a script execute on a local timer that will check the database if there are any entries, if so it will grab all of them and insert them into a local mySQL database that is on that computer. Now, I believe I can do this using SOAP to call a php function off the web server. Does anyone know coding to Grab all entries in a MYSQL Database table, and essentially insert them into another MYSQL (Which would be local on the computer executing the script). I also plan on actually deleting any entries that have been grabbed and put on this local database. Summary: Basically, I'm constantly backing up a MYSQL Database, but not exactly. I'm adding whatever new stuff comes to a complete local MYSQL Database.
View Replies !
|