Jump to content

Complete Newbie struggling to insert PHP


Williams

Recommended Posts

Hi guys, I've been dabbling with HTML and flash for a few years, only as an end user really, with my own set of websites

 

I want to get a selection of records from MySQL into different pages, and although I've mapped the testing server (MAMP & PHPMyAdmin) as localhost, I can access the database via CS4, and create relevant working queries in both bindings and server behaviours, that's where I grind to a halt.

 

No matter how I do it, drag, copy or insert the code into my existing HTML or newly created PHP page, the code shows, but the results don't.

 

I'm convinced this is the most basic of errors, hence why 2 days of googling and watching Stefan's great video's is not getting me anywhere. It's perhaps so obvious to you guys, nobody thought to explain it to a dummy like me ! :-)

 

I'm happy to dump my code here, although I don't think you'll need it for the one line answer that will save my sanity !!

 

Thanks !!!

 

Pete MAC-Leopard/CS4 suite/ MAMP/PHPMyAdmin

Link to comment
Share on other sites

Only other thing is that the connection include is pointing to your desktop file. This connection should point to a file on your php server.

 

<?php require_once('file:///Leopard/Users/pete/Documents/Web%20Sites/mobiledjnetwork.co.uk/Connections/MDJN.php'); ?>

 

This should have no "file:///" in it and it should be in the "www" folder of your MAMP folder.

Link to comment
Share on other sites

Only other thing is that the connection include is pointing to your desktop file. This connection should point to a file on your php server.

 

<?php require_once('file:///Leopard/Users/pete/Documents/Web%20Sites/mobiledjnetwork.co.uk/Connections/MDJN.php'); ?>

 

This should have no "file:///" in it and it should be in the "www" folder of your MAMP folder.

 

Well spotted !

 

I've now regenerated the query in server behaviours into a fresh page, and still nothing displays (still no code in the body tags)

www.mobiledjnetwork.co.uk/phptest.php

 

I've also done this for a second page with your suggested code in the body tags, but still nothing ! This time with no query as such, just requesting the whole table to be displayed

www.mobiledjnetwork.co.uk/phptest2.php

 

As you'll see from the live pages, I'm getting a warning (dont see this locally), but the line referance it quotes is not in the code !

 

 

 

Thanks for your ongoing help !!

Link to comment
Share on other sites

More info that may be of use -

 

phpMyAdmin comes of course with a couple of DB's of it's own, so in case it was my use of phpMyAdmin, I have also tried inserting the code within CS4 to get the full info from those without filtering anything.

 

The test works when setting up the binding or server behaviour, but the page still doesn't produce any results

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...