php preview with webuilder 8.0.2.77

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
daredare
Posts: 125
Joined: Sun Sep 09, 2007 1:40 pm

php preview with webuilder 8.0.2.77

Post by daredare »

hello,

i am trying to use the php function mysql_connect

everytime i try to connect i got in the preview window of webuilder an error message:

Fatal error: Call to undefined function mysql_connect()


i already have installed php in my computer so i can preview php in webuilder , what is causing this error ? do i need to install something else locally to have mysql_connect() working?

thanks
daredare
Posts: 125
Joined: Sun Sep 09, 2007 1:40 pm

Post by daredare »

is it possible to use the mysql functions that php has within webuilder preview?
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

This looks to have nothing to do with WeBuilder, most likely there is an error in PHP configuration. Make sure you have enabled mysql support in PHP.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Post by chrisjlocke »

mysql_connect obviously needs MySQL installed to run, as its part of that library.
php.exe is just for the 'core' of php - ie, just the basics.

I recommend Xampp (http://www.apachefriends.org/en/xampp.html). It installs php, mySQL, phpMyAdmin, etc all in one package. It honestly couldn't get any simpler.

Download the main package, and switch it to use whatever php version you're using, eg, php4. php5 is installed by default.
daredare
Posts: 125
Joined: Sun Sep 09, 2007 1:40 pm

Post by daredare »

i downloaded xampp and installed it , but i still cant connect to my db even in root mode

i wrote in webuilder:


mysql_connect("localhost", "root", "");


but the preview window shows a blank page?
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Post by chrisjlocke »

Thats OK then isn't it? No error.
You now have to write the code to extract the records and display them.
daredare
Posts: 125
Joined: Sun Sep 09, 2007 1:40 pm

Post by daredare »

thank you, now i can connect locally, it works.
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Post by chrisjlocke »

Glad you got it working. \o/
Post Reply