Pb using mysql with php
I currently have apache/php/mysql installed.
[root@gaboo /]# pacman -Qi | grep apa
apache 2.0.53-2
[root@gaboo /]# pacman -Qi | grep mysql
mysql 4.1.10-1
[root@gaboo /]# pacman -Qi | grep php
php 5.0.3-5
But when I tried to make a mysql connection, I get
Fatal error: Call to undefined function mysql_connect() in /home/httpd/gg/pageprincipale.php on line 16
Moreover, when I display this php page :
<?php phpinfo(); exit(); ?>
I don't have a mysql section, displaying its settings.
The mysql extension is built-in into php5, everything seems at the right place, I can't find why it doesn't work.
Any ideas ? :?:
usedtire wrote:
THis is just plain dumb. I had to create this link
ln -s /usr/lib/php/extensions/no-debug-non-zts-20041030/mysql.so /usr/lib/php/mysql.so
to get it to work.
WHY??
It works, but how often do I need to this? Everytime Pacman upgrades?
Instead, you can change the line:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20041030/"
of your /etc/php.ini file
Similar Messages
-
Hello,
I have standalone OC4J and I want to use mySQL database (Oracle is no problem). My data-sources.xml for application (not global data-sources) is:
<data-sources>
<data-source class="com.evermind.sql.DriverManagerDataSource"
connection-driver="org.gjt.mm.mysql.Driver"
ejb-location="jdbc/MG_DBDS"
inactivity-timeout="30"
location="jdbc/MG_DBCoreDS"
name="MG_DBDS"
password=""
pooled-location="jdbc/MG_DBPooledDS"
url="jdbc:mysql://127.0.0.1:3306/test"
username="root"
xa-location="jdbc/xa/MG_DBXADS"/>
</data-sources>
Deploy return me:
Error initializing data-source 'jdbc/MG_DBCoreDS': DriverManagerDataSource driver 'org.gjt.mm.mysql.Driver' not found
Then I run this command:
java -jar %OC4J_HOME%\admin.jar ormi://192.168.1.14:23791/ admin heslo -application Register -updateDataSource -oldLocation jdbc/MG_DBCoreDS -jar mysql-2.0.11-bin.jar
this action is success and create in OC4J folder lib with jar file mysql-2.0.11-bin.
When I use this configuration in application, I get connection but creating Statement cause SQL Exception - No suitable driver.
When I try to restart OC4J, I get the same message as throught deploy - Error initializing data-source ...
What is go wrong???? Could me help anyone?
Thanks
Liborpooling solution:
1) put driver mysql.jar into any directory wich described in OC4J application.xml file like
" <library path="D:\j2ee\home\lib">jdev-generated</library>"
2) put a new datasource in data-sources.xml:
<data-sources>
<data-source name="MySqlDS"
location="jdbc/MySqlDS"
class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
max-connections="100"
min-connections="5"
inactivity-timeout="200"
wait-timeout="10"
username="scott"
password="tiger"
url="jdbc:mysql://localhost:3306/oln?useUnicode=true"/>
</data-sources>
OC4J needs a special pooling class in comparision with other containers. For example, JBoss has own implementation of pooling broker, so pooling is enabled by default. -
What is best method for learning how to use mySQL with Coldfusion?
I have been using access databases for years with Coldfusion. I have a client that wants me to build an online classroom. I figure it's time to finally start using mySQL, but there is so much info out there, I don't know which way to turn.
Where do you experts recommend I get started?
Also, I am using coldfusion entrprise on my system at home. My machine is a 64-bit, 3.30Ghz AMD FX - 6100 six-core processor with 8gig of ram. Can I install mySQL on the machine and run CF8 without any problems?How much RAM left on your system? If the computer is strictly for development, then you have more than enough to run ColdFusion, MySQL, browsers, and other development tools.
For MySQL download the MySQL Community Server and MySQL Workbench. There is also all-in-one package for Windows, http://dev.mysql.com/downloads/windows/installer/ that you don't need to download the server and workbench separately. The installation should be straight forward.
By the way, other CF users may suggest you to use MariaDB (https://mariadb.org/), which is a branch of MySQL. -
Hi, I am writing a database program, and I decided I should try and use MySQL since many people have told me it is the best way to make a database. Does the java version that Sun provide come with the api to create mysql databases?
Also, I would like to know of a good tutorial that teaches MySQL with java.Hi, I am writing a database program, and I decided I
should try and use MySQL since many people have told
me it is the best way to make a database. Does the
java version that Sun provide come with the api to
create mysql databases?
You are more than a bit confused so please stop here until you understand the following.
JDBC is the API for communicating with relational databases in Java. It is not a database in and of itself but it can communicate with any database that provides JDBC API access in the form of a JDBC driver.
Also, I would like to know of a good tutorial that
teaches MySQL with java.The Sun tutorial on JDBC may be found here http://java.sun.com/docs/books/tutorial/jdbc/index.html
Your using (or not) MySQL is not relevent on this forum and any questions you have regarding MySQL (with the exception of one) are beyond the scope of this forum.
The exception is "Is there a JDBC driver for MySQL and how do I use it". The answer to that question is yes and see this http://www.mysql.com/products/connector/j/ -
Using mysqli in PHP 5.3.10
I am using OS X Lion 10.7.4. I want to use mysqli API in my PHP script, but the manual says I have to install it. Plaese tell me how to install it
Start here: https://discussions.apple.com/docs/DOC-3083
and move to to here: https://discussions.apple.com/docs/DOC-3082 -
Using MySQL with JDeveloper 3.2 in a BC4J JSP Application
Hi!
I'm trying to create a BC4J JSP application using MySQL.
I'm using the mm.mysql-2.0.4-bin.jar which I've registered in
IDE and ClassPath. I created a connection with the option Other
JDBC.
I tested successfully the connection in the Connection Manager.
After, I created a new project with BC4J. Using the 'tester' I
got an error: no suitable driver.
While editing the created view object I got a SQLException when
I clicked in Attribute Mapping.
How to solve this problem? I realized that other people here had
this kind of problem but nobody gave a definitive solution.
Thanks.Ok, I'm doing exactly the same Jdevloper BC4J over mySQL.
I got one step further.
In order to solve your problem:
1. Add AddJavaLibFile ../lib/mysql_comp.jar (or whereever
is your mysql driver) in bin/jdev.conf.
resart the application
In that case your driver will be available for all tasks.
It works for me.
My problem:
When I run the Tester for my generated module, I obtain:
No attribute with the Primary key property was found...
Can you emeil me the procedure if you find how to use
BC4J over mysql -
Using MySql and PHP with Dreamweaver on a Mac
Hello all,
As always if the answers to these questions are obscenely
obvious please humour me.
I use XHTML and CSS in my websites and realise that it is
time that I dabbled with SSI. So I've started using PHP.
However, I have been following the installation directions of
MySql and am running into problems. I am installing the relavent
software and am then unable to find it on my Mac, the startup files
are there but the actual MySql data appears to not be installed
despite my computer telling me it is...... I am using a G3 running
OSX 10.4 is this good enough? I noticed talk of needing a PowerPC
or Intel mac. Is this the case?
Also, would I need MySql installed on my actual computer if
the my servers have it already? And does Dreamweaver 8 have both of
these programs installed as standard?
If you could help out I would be very appreciative as I would
like to learn this stuff and I appear to be struggling at the
outset....
Cheers
M.AM.A.Wilson wrote:
> However, I have been following the installation
directions of MySql and am
> running into problems. I am installing the relavent
software and am then unable
> to find it on my Mac, the startup files are there but
the actual MySql data
> appears to not be installed despite my computer telling
me it is...... I am
> using a G3 running OSX 10.4 is this good enough? I
noticed talk of needing a
> PowerPC or Intel mac. Is this the case?
MySQL is a relational database management system that
comprises a
database server and several utility programs. Although you
install it
like any other program on a Mac, the similarity stops there.
First, the point about PowerPC and Intel Macs is that there
are
different versions of the MySQL installer for each type of
processor.
I'm pretty sure that a G3 is OK, but you must choose the
PowerPC version
of MySQL, not the 64-bit or x86 (Intel Mac) version.
Once you have installed MySQL, you need to drag the
MySQL.PrefPane icon
from the disk image onto your System Preferences. This
installs a
Preference Pane that enables you to start and stop MySQL. The
Preference
Pane has an option to start up MySQL automatically, but in my
experience, it doesn't work on Tiger. You need to open the
Preference
Pane, and click Start MySQL Server each time you start your
computer.
The best way to work with MySQL is to use a graphical
interface, such as
phpMyAdmin. As Osgood has mentioned, I have written a book
about PHP and
Dreamweaver, which goes into all the necessary details. It's
also very
Mac-friendly with separate instructions where necessary for
PC and Mac.
More details here:
http://foundationphp.com/dreamweaver8/
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
How to use html Tags from MySQL with PHP
I like HTML tags like <b>bold</b> or <BR>
and others placed in the MySQL database and used by PHP to show up
in my pages but I don't succeed. I tryied HTML encode
(htmlentities) from the bindings POP-up menu but nothing happened.
What is the way this should be acomplished and where is HTML
encode (and the others in the pop-up menu) being used for?
Any help will be appreciated,
Josarnhemcs wrote:
> I like HTML tags like
bold or <BR> and others placed in the MySQL
> database and used by PHP to show up in my pages but I
don't succeed. I tryied
> HTML encode (htmlentities) from the bindings POP-up menu
but nothing happened.
Just store the HTML as plain text in your database. Using
htmlentities()
turns < into < and so on. Using it is what's
preventing your HTML
from displaying correctly.
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/ -
Anyone use Flex with php for file upload? PHP Notice: Undefined index: Filedata
My code works. It uploads the file and inputs the file name into a database, but I can't shake this php notice. I think php is looking for multipart/form-data from the HTML form tag.
<form action="upload.php" enctype="multipart/form-data"/>
But I am using flex. The multipart/form-data info is sent as the second default argument of the upload() function. Does anyone have experience with this? Thanks.
PHP Notice: Undefined index: Filedata
$filename = $_FILES['Filedata']['name'];
public function selectHandler(event:Event):void {
request = new URLRequest(UPLOAD_DIR);
try {
fileRef.upload(request);
textarea1.text = "Uploading " + fileRef.name + "...";
catch (error:Error) {
trace("Unable to upload file.");
textarea1.text += "\nUnable to upload file.";Hi, Thanks for your reply !
Im not getting any errors Flex side, as i say i get a alert message saying the file has been uploaded so . .
I am using a Wamp server on a windows machine, how do i check the file permissions on both the folder and the php file ?
Also how do i debug a php file ?
ANy help would be thankful ! -
Retrieving Images from Mysql with PHP
Hi I have been trying to work this out with no success so some help would be really appreciated.
I have two tables in Mysql,
IMAGES AND EXHIBITORS
IMAGES
`image_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT ,
`filename` VARCHAR(255) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
`mime_type` VARCHAR(255) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
`file_size` INT(11) NOT NULL ,
`file_data` LONGBLOB NOT NULL ,
`user_id` VARCHAR(50) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
`accom_id` INT(5) NOT NULL ,
`exhibitors_exhib_id1` INT(5) NOT NULL ,
PRIMARY KEY (`image_id`, `exhibitors_exhib_id1`) ,
INDEX `user_id` (`user_id` ASC) ,
INDEX `accom_id` (`accom_id` ASC) ,
INDEX `fk_images_exhibitors2` (`exhibitors_exhib_id1` ASC) ,
CONSTRAINT `fk_images_exhibitors2`
FOREIGN KEY (`exhibitors_exhib_id1` )
REFERENCES `christmas_shopping`.`exhibitors` (`exhib_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARACTER SET = latin1
COLLATE = latin1_bin
EXHIBITORS
`exhib_id` INT(5) NOT NULL AUTO_INCREMENT ,
`exhib_name` VARCHAR(50) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
`exhib_years` SET('2010', '2009') NULL ,
PRIMARY KEY (`exhib_id`) )
ENGINE = InnoDB
AUTO_INCREMENT = 3
DEFAULT CHARACTER SET = latin1
COLLATE = latin1_bin
PACK_KEYS = DEFAULT
I think I am happy with the Mysql, and I have read the various arguments about storing images in mysql but for my purpose I wanted to store the image in the database.
I have already created the upload and the images have uploaded correctly and I can see the data in the database, however I just have been able to retrieve the images back into a webpage.
I have a .php file which is merging these to tables correctly but the image is displayed as
o¿9®áŸÇ½G_ŒÁ%×Úoíø$M©7ûiè Óµ|Mn.˨â=Ž2Z ¥<º½Hs/¸úfŠÇðïˆ-üE`· ¯üq÷C[ öTªÂ´ Jnéžl¢âÜdµ (¢µ$(¢Š�(¢Š�(¢Š�(¢Š�(¢Š�(¢Š�CÅ Š:šZ�(¢Š�(¢Š�) -! ¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¯ ý¤Z_ x^óÐK2ZJ»¦ò>ô»NJ ûç¥{6½©.‘£ÝÞ ÆZ¼*-Sûz"$pÌ]$þ%5ù¿ æ•0˜xa©;9êý O›=¼³ ªÍÔžÈøžþ t·[c*¦À T?wøQ·/?ίøWÅ×z]Ü r츌þæLôoâVþð¯jøÍð¶O Y½Îœ¨Œ›–k4OšWþê·mß1÷/ Abž<[Þ¢þþÕŠþ÷û۝}nCžÏ*š¡]Þ“ü?¯ëÏ‹ …X¨óÇIþgÔÔVf‹¬Ûë¶)snÙVê½Á:ý¶ H©ÁÝ=–iÅÙî QEh ¢Š(�¢Š(�¢Š(�¢Š(�¤4´‚€ Š( Š( Š( Š( qKHh Ð ÑE �QE �QE �QE �V^½ª¦‡¥^²ï .í¾µ©^kñÿ�Z Ã]NmÛY“
The code I have in the page is as follows. After many hours of trying to work it out I just cant see what I am missing and would really appreciate some help. I have highlighted where the echo is that relates to my image.
<?php require_once('../Connections/christmas.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$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":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_christmas, $christmas);
$query_Recordset1 = "SELECT exhibitors.exhib_name, images.file_size, images.file_data FROM images, exhibitors WHERE images.exhib_id = exhibitors.exhib_id";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $christmas) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php $pagetitle="The Christmas Shopping Fayre"?>
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="Content-Type" content="; charset=" />
<link href="../public/CSSFiles/oneColElsCtrHdr.css" rel="stylesheet" type="text/css" />
<link href="../public/CSSFiles/whitebackground.css" rel="stylesheet" type="text/css"/>
<link href="../public/CSSFiles/shoppingonline.css" rel="stylesheet" type="text/css"/>
<link rel="icon" type="image/x-icon" href="http://www.gravatar.com/avatar/c4dac336c5be729fc542c12bfbb50099.png" />
<!--[if IE]>
<style type="text/css">
a { zoom: 1;}
</style>
<![endif]-->
<script type="text/javascript">
<!--
function MM_showHideLayers() { //v9.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3)
with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
//-->
</script>
</head>
<body id="shoppingonline" class="oneColElsCtrHdr">
<p> </p>
<?php include("includes/header.php"); ?>
<br />
<br />
<div id="bannersp"> </div>
<h1>Welcome to <?php echo $pagetitle?></h1>
<p>
</p>
<form method="post" name="form1" id="form1">
<p> </p>
<table border="1" cellpadding="5" cellspacing="5">
<tr>
<td>exhib_name</td>
<td>file_size</td>
<td>file_data</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['exhib_name']; ?></td>
<td><?php echo $row_Recordset1['file_size']; ?></td>
<td><?php echo $row_Recordset1['file_data']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php include("includes/footer.php"); ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>Hi Murray
You must despair with beginers like me, attachments showed as having been
sent so lets try again.
I have been able to find a tutorial that works well all the way through, I
can even see the images in the browser!! but only shows images individually
on a page.
http://www.phpriot.com/articles/storing-images-in-mysql/7
However, what I want to do is to have a page that links my images table and
another table, all of which I have set up and is working other then showing
the images. All was very straight forward until sorting out the image. If
I can work out what to take from the above tutorial that works into my page,
I am sure all will be fab.
Storing them in the mysql was my preferred method as there are not alot and
they can be low resolution and I thought it would be fairly straight
forward!! however finding out that I am having to adapt code as dreamweaver
doesn't support the blob attribute is getting me out of my knowledge.
All the best
Gilly
Attachments inserted
show_image.php
<?php require_once('../Connections/getImage.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$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":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$colname_Recordset1 = "-1";
if (isset($_GET['image_id'])) {
$colname_Recordset1 = $_GET['image_id'];
mysql_select_db($database_getImage, $getImage);
$query_Recordset1 = sprintf("SELECT image_id, mime_type, file_data FROM images WHERE image_id = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $getImage) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
header('Content-type: ' . $row_getImage['mime_type']);
echo $row_getImage['file_data'];
mysql_free_result($Recordset1);
?>
view.php
<?php require_once('../Connections/getImage.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$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":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_getImage, $getImage);
$query_Recordset1 = "SELECT * FROM images";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $getImage) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table border="1" cellpadding="5" cellspacing="5">
<tr>
<td>image_id</td>
<td>filename</td>
<td>mime_type</td>
<td>file_size</td>
<td>file_data</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['image_id']; ?></td>
<td><?php echo $row_Recordset1['filename']; ?></td>
<td><?php echo $row_Recordset1['mime_type']; ?></td>
<td><?php echo $row_Recordset1['file_size']; ?></td>
<td><?php echo $row_Recordset1['file_data']; ?></td>
<td><img src="show_image.php?image_id=<?php echo
$row_getdetails['image_id']; ?>" alt="Image from DB" />
</td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?> -
Using CSS With PHP..
Hello!
I need to create several PHP-based pages for use with a photo gallery and would like to use my existing CSS to style the pages. Is this possible?
Thanks!You certainly can; just link to your existing stylesheet as with an html page
-
Hi Team,
I have an OEP running with Oracle DB but I need to move to MySQL.
Has anyone done this?
What is required?
ThanksHere are the steps which should be used:
1. Created a bundle jar for mysql driver(followed steps as per the OEP documentation )
Goto $ORACLE_HOME/oep/bin in server installation directory
Run the following script
sh bundler.sh -source /scratch/sbishnoi/view_storage/sbishnoi_india/cep/wlevs_cql/release/target/server/oep/bin/mysql-connector-java-commercial-5.1.34-bin.jar -name mysql5 -version 5.1.34 -factory com.mysql.jdbc.jdbc2.optional.MysqlXADataSource com.mysql.jdbc.Driver -service javax.sql.XADataSource java.sql.Driver -targetdir .
The generated jar will be in the current directory and its name will be mysql5_5.1.34.jar.
Please note that the connector jar mysql-connector-java-commercial-5.1.34-bin.jar was part of MySQL Server installation and wasn't download it separately.
2. Manually edit the MANIFEST.MF of newly generated jar mysql5_5.1.34.jar to remove unwanted imports which may cause you to download dependencies.
The import section for my jar looks like as follows:
Import-Package: javax.crypto,javax.xml.stream,javax.sql,javax.naming,javax.xml.transform.dom,javax.naming.spi,org.xml.sax,org.xml.sax.help
ers,org.w3c.dom,javax.xml.transform.sax,javax.transaction.xa,javax.management,javax.xml.transform.stax,javax.xml.parsers,javax.xml.transfo
rm,org.osgi.framework,javax.xml.transform.stream,javax.xml.datatype,javax.net.ssl,javax.net
3. Copy the driver bundle jar into following server directory inside domain directory:
$ cp mysql5_5.1.34.jar …….user_projects/test_domain/defaultserver/modules/ext/
Create modules/ext directories if it doesn’t exist and then copy the jar.
4. Prior to starting server, Edit the server’s configuration to define the datasource.
Here is config.xml file which we tried:
<data-source>
<name>mysql</name>
<data-source-params>
<global-transactions-protocol>None</global-transactions-protocol>
</data-source-params>
<connection-pool-params>
<test-table-name>SELECT 1 FROM DUAL</test-table-name>
<initial-capacity>5</initial-capacity>
<max-capacity>10</max-capacity>
</connection-pool-params>
<driver-params>
<url>jdbc:mysql://10.159.165.60/mysql</url>
<driver-name>com.mysql.jdbc.Driver</driver-name>
<properties>
<element><name>user</name><value>mysql</value></element>
<element><name>password</name><value>mysql</value></element>
<element><name>com.bea.core.datasource.serviceName</name><value>mysql5</value></element>
<element><name>com.bea.core.datasource.serviceVersion</name><value>5.1.34</value></element>
<element><name>com.bea.core.datasource.serviceObjectClass</name><value>javax.sql.XADataSource</value></element>
</properties>
<use-xa-data-source-interface>false</use-xa-data-source-interface>
</driver-params>
</data-source>
5. Now Start the server. Make sure MySQL Database is running on the URL mentioned in config file.
Although on server startup, you will see the following exception(not to worry about):
[sbishnoi@adc2101019 defaultserver]$ sh startwlevs.sh
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
<Dec 19, 2014 6:39:52 AM PST> <Notice> <LibExt> <BEA-000000> <The extension library bundle "mysql5" was started successfully>
<Dec 19, 2014 6:39:54 AM PST> <Notice> <LoggingService> <BEA-320400> <The log file /net/adc2101019/scratch/sbishnoi/view_storage/sbishnoi_india/cep/wlevs_cql/release/target/server/user_projects/test_domain/defaultserver/server.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms, such as Windows.>
<Dec 19, 2014 6:39:54 AM PST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /net/adc2101019/scratch/sbishnoi/view_storage/sbishnoi_india/cep/wlevs_cql/release/target/server/user_projects/test_domain/defaultserver/server.log00014. Log messages will continue to be logged in /net/adc2101019/scratch/sbishnoi/view_storage/sbishnoi_india/cep/wlevs_cql/release/target/server/user_projects/test_domain/defaultserver/server.log.>
<Dec 19, 2014 6:39:58 AM PST> <Error> <JDBC> <BEA-001112> <Test "select count(*) from SELECT 1 FROM DUAL" set up for pool "mysql" failed with exception: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'SELECT 1 FROM DUAL' at line 1".>
<Dec 19, 2014 6:40:00 AM PST> <Error> <JDBC> <BEA-001112> <Test "select count(*) from SELECT 1 FROM DUAL" set up for pool "mysql" failed with exception: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'SELECT 1 FROM DUAL' at line 1".>
<Dec 19, 2014 6:40:00 AM PST> <Error> <JDBC> <BEA-001111> <Unable to verify the test "select count(*) from SELECT 1 FROM DUAL" set up for pool "mysql". Connections will not be tested. The test will not be used by isValid either.>
These are related to some configuration test query execution on database to ensure connectivity. The exception here is SQL syntax which is not a connectivity issue so we can safely assume that connection is obtained. -
Looking for a class or suggestions to be able to upload pdf file, save pdf file on server repository, convert the pdf to plain text, and store plain text in mysql text field so it's search friendly. Simple right!
any suggestions? any known classes? Thanks in advance.
forgot to mention, docs are on average 100 pages long, so i don't think blobbing it is the right approach.There are many classes / ways to put text. HTML or record set results into a PDF, but to extract content out of a PDF and convert it into plane text that could then be written to a database... To my knowledge, there isn't any. You're only option may be to store the PDF docs on the server then catalog them in the database with the URL location of the docs. For searchability you could add a field that could could contain keywords sample text of what is in the doc - this could be cut and pasted into a field when adding the PDF to you "catalog".
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer
www.facebook.com/LawrenceCramer -
Dreamweaver CS3 for MAC bug / MySQL with PHP
I am using DW for Windows for over 4 years, this time I have
to change my desktop to a MACBookPro because of the long run time
on battery and best 17" laptop screen. But DW CS3 cannot connection
to my MySQL database on my remote server like Windows version.
After talking to Adobe tech support, they acknowledge that it is a
software bug and there is no fix nor work around. I paid a lot of
money for the CS3 Design premium suite and it is frustrating that
Adobe does event test this basic function and all tech support can
give me with my premium support contract is they submitted bug
report and there is no ETA or anyone will alert me when a fix is
available!!!!!
I just like to share this so any one is thinking about using
Dreamweaver for MAC and need MySQL, you should check with Adobe
before pulling you credit out.I've been a Mac convert for about 2 years now. Right now, I'm
running DW CS3 on an Intel iMac and it runs beautifully. On my
Powerbook G4 (1.33 GHz PPC G4 and 2 GB of ram) the performance is
slightly lacking. One thing to be wary of with adobe products -
they can be memory hogs. Photoshop is especially notorious for
this.
Also, the more you have installed on a Mac laptop, the slower
it will run. Mine used to take a few minutes to boot because of all
the programs I had installed, and nothing was starting up with the
machine. After a format and clean install it runs like new.
That is something for you to consider, if you have all the
necessary software to reinstall everything you want. I never turn
off any features in DW and I have only had a few buggy problems.
Nothing major though. -
Concatenate fields when UPDATING mysql with php
I have managed to concatenate 2 form inputs (firstName +
lastName = fullName) when Inserting a record by altering the
Dreamweaver code thus:
$insertSQL = sprintf("INSERT INTO personnel (id, firstName,
lastName, fullName) VALUES (%s, %s, %s, ('$_POST[firstName]
$_POST[lastName]'))".......
Not sure how correct this is but it works.
So I tried doing the same thing with an UPDATE page and it
doesn't work
$updateSQL = sprintf("UPDATE personnel SET firstName=%s,
lastName=%s, fullName=('$_POST[firstName]
$_POST[lastName]'))".......,
Does anyone have a clue why this will not work or a better
way of Concatenating these form fields.
thanks.oO(MickWarnes)
>I have managed to concatenate 2 form inputs (firstName +
lastName = fullName)
>when Inserting a record by altering the Dreamweaver code
thus:
>
> $insertSQL = sprintf("INSERT INTO personnel (id,
firstName, lastName,
>fullName) VALUES (%s, %s, %s, ('$_POST[firstName]
$_POST[lastName]'))".......
Why do you store redundant data? If you already have the
firstName and
lastName, there's no real need to also store the
concatenation of both.
If you need the fullName in your application like I do for
example, then
"create" it on the fly when you query the DB:
SELECT
firstName,
lastName,
CONCAT_WS(' ', firstName, lastName) AS fullName
FROM
With the same method I even include an optional birth name if
available:
SELECT
IF(birthname IS NULL OR birthname = '',
lastname,
CONCAT(lastname, ' (', birthname, ')')
) AS fullLastname,
Another thing: Never(!) use $_GET or $_POST data directly in
a DB query
without validation and escaping. Read about SQL injection and
how to
prevent it, for example with calling
mysql_real_escape_string() before
the data goes into the DB. DW inserts its own function to
solve this,
but your addition in the code above doesn't make use of it,
hence your
code is vulnerable.
Micha
Maybe you are looking for
-
Mid 2010 Macbook Pro - USB & Midi Issues
It all started when I recently bought a Pioneer DJM-900srt and switch from Traktor to Serato Dj. Now, I have been using my current Korg Nanocontrol for about 2 years problem free using manly Ableton Live 8 and Traktor Pro 2. Never needing to download
-
How to connect envy to non wirelss computer
how do i connect a usb cable to envy 114
-
I am not a computer programmer who knows what a Boleen page is. I need a step by step instruction on how to disable the new thumbnail page. I just want it to do what it used to do when I opened up a new page - go to my homepage. I am using OSX 10.9.5
-
Mark an object in real time on a displayed video acquired from an USB camera
Hello, I am a beginner LabView user undertaking a project in which I need to show video acquired from an USB camera in LabView on computer screen. In the video, there will be a metal part, which is always be at a fixed position at the bottom left of
-
For those who want to know more about the S5, you can go to http://www.gottabemobile.com/. The site is not specifically about the S5, but I found the site to cover a lot of topics about Android and other phones. There are many articles about the the