Dreamweaver CS3/4/5 - Databases and PHP

Pixelbender

Senior Member
Joined
Jul 5, 2009
Messages
729
Reaction score
4
Location
Gauteng, Chancliff
Hey guys

So, I've been designing html websites for years and I'm now starting to dabble in php, mysql and especially the dreamweaver side of it, since I got myself CS5, as it seems to have some potent features, especially if you go a bit deeper than the normal query or database call. Im not talking about the cms plugins, I'm not interested in those. Pure html, css, php and mysql...

By no means is it perfect but for a designer trying his hand at some BASIC php stuff, I think it'll work. Plugins or not.

So I've created a small application, very proud of myself, but I'm struggling with one thing.... Are there any php developers out there who specialize in php and dreamweaver and mysql, especially as a complete solution...? One who can help me with it, its seems very basic, almost like a sessions thing.

Thanks Anton
 
i hate dreamweaver..

i worked with it once. with html , css, javascript, php..
and it created lots of unneccesary code.
which made load times of my websites so slow..

good luck.
 
i hate dreamweaver..

i worked with it once. with html , css, javascript, php..
and it created lots of unneccesary code.
which made load times of my websites so slow..

good luck.

Sounds like you were doing it wrong.
 
Thanks for the replies sofar

I have not really seen Dreamweaver add useless code at all, I know, I also used to be a "notepad'er" - but dreamweaver is better nowadays and I dont really see unneccesary code, other than comments, which you can strip out in the time it takes you to start any other web app.

@dequadin - i wanted to see if theres a few guys out there who knows the application inside out and can help me out..

Anyway, the problem is, that I have a master results page, linking to a detail page, which all works fine, and I've added an update page, added a edit link, going to the update page, next to the result row on the details page, so essentially, I should be able to click on the edit link, and it should take me to the update page, which it does, but it gives the first result in the database, instead of the result row I clicked to edit.

Ive tried to add all sorts of ?recordID=<?php stuff to the end of the url, but it still takes all the results to the first row in the database table, on top of that, when I edit that anycase, it doesnt update.
 
Okay, kinda thought that, but how would I know which code to post? And I will only be able to do it at home, tonight though....

I guess you want the results page, the details page and the update page...? I'll put it on a server for download in a zip file.

Thanks.
 
Okay, it's 23:23 and I figured it out, instead of edit-user.php?id=<?php echo $row_recordsetname['id']; ?> I was following online tips giving ?recordID=<?php echo $row_recordsetname['id']; ?>

Seems like (well obviously) the red ones in the following line must correspond and you cant just use any word ie: RecordID etc... edit-user.php?id=<?php echo $row_recordsetname['id']; ?>

Can anybody tell me (A graphic designer) why or just how the above mentioned statement works - they dont tell you these in books. In other words... Draw a picture - if you feel creative, go for it, as long as we get to a point in the end ;-)
 
Last edited:
No no no.... Dreamweaver DOES add a crapload of uneccesary code.... and it's horribly dirty. And if you edit an insert/update transaction, you cannot add some others that are based on top of it (such as the email function in CS4, etc).
I use Dreamweaver for the sole reason that I spend like 1% of my time in design view, just checking out the tables or doing some nifty design stuff that take 10x as long in code view.

Okay, it's 23:23 and I figured it out, instead of edit-user.php?id=<?php echo $row_recordsetname['id']; ?> I was following online tips giving ?recordID=<?php echo $row_recordsetname['id']; ?>

Seems like (well obviously) the red ones in the following line must correspond and you cant just use any word ie: RecordID etc... edit-user.php?id=<?php echo $row_recordsetname['id']; ?>

Can anybody tell me (A graphic designer) why or just how the above mentioned statement works - they dont tell you these in books. In other words... Draw a picture - if you feel creative, go for it, as long as we get to a point in the end ;-)

What happens above is the following:
You have a url link, right? (edit-user.php)
You then have a parameter (starts with a ?, 2nd+ parameters use a &) ie url.php?parameter1=xxx&param2=xxx2&p3=xxx3
But you cannot simply post the "parameter value" in plaintext <html>..... <a href=url.php?id=$dev>ggg</a> </html> because the $dev is a php variable and html does not understand this.
For this reason you have to print the variable using php:
Code:
<?php //start php mode//
echo $variable; //print the variable to screen/code
//end php mode ?>
Now in your case, you have $row_recordsetname['id'] ..... the row_recoprdsetname is an array, returned from a mysql_query (to be precise, mysq_fetch_array or other function), with id being the reference (it uses id,email,username, etc etc instead of 01,2,3,....99, etc).
Now in the edit-user.php page, if you use
Code:
echo $_GET['id'];
Then you will print out the value of $row_recordsetname['id'], assuming it exists (checked using
Code:
if(isset($_GET['id']))
).
 
I've no idea (and don't really care) if Dreamweaver lets you debug your php code but that is where you should first start looking otherwise use Netbeans PHP for your IDE with a server side debugging plugin which I forget the name of at this moment.
 
zend debugger / xdebug (i use the latter).
get yourself a php chm and head on over to stackoverflow - they may have a bigger pool of dreamweaver coders.
 
xdebug, that's it.

I forget what if any hassles I had with zend debugger but it landed in the trash bin so there must've been some issue with it.
 
no matter which forums you go to on the net, you always come across Dreamweaver bashes. I use dreamweaver alot, and dont see that much unnecessary code. The unnecessary code that it spits out is easy to pick up and remove. Beats the hell out of spending your whole day coding. :)
 
At least when you code by hand (using vi obviously), you exactly what is going on in your code, and you will not struggle with something as small as this. Just my 2c, might be true for some, and not for others.
 
Thanks for the replies.... Remember, I have no coding experience whatsoever, so struggling with something as small as that wouldve been an even bigger problem if I had coded it by hand... Mind you, I might have built a script that drops a table instead of validating a session :-P

Anyway, seriously, I'm only dabbling in php and thats why I'm asking questions... If I had a remote idea of what I was doing at that time, I wouldnt have asked that question, anyway, Ive managed and I know now.
 
If you have no coding experience then learn to copy paste and step through e.g. code (debug) that lets you watch what the code does to your variables and arrays. It's all about manipulating strings and other data formats from various sources and learning the languages syntax mostly with keeping code reuse in mind for repetitive tasks (functions). Surely you've coded some javascript or written some SQL?
 
Hey Drake,

Thanks, yeah, sure, I've done the copying and pasting etc and thats the main reason I chose to go with php an mysql as I have some experience in managing these sites and fooling aound with some of the code.. but since I got CS5, I kinda got into the mood of doing some basic stuff myself, then I don't always need to pay a freelancer to do the simple stuff...

Anyway, I'll keep on trying... Kinda got over the hump right now and I do see a way forward, the plan was never to become a serious coder and I guess that comes with experience anyway... So - I'll just keep on keeping on.

;-)
 
So, I kinda figured it out - you should not set "filter by id" in the recordset on the page where you click the link to update the specific record, but you should set "filter by id" on the recordset on the "receiving" page... am I right?
 
So, I kinda figured it out - you should not set "filter by id" in the recordset on the page where you click the link to update the specific record, but you should set "filter by id" on the recordset on the "receiving" page... am I right?

If I understand what you mean, yes.

On the page where you update (ie update.php?id=45) you will have
PHP:
$query = "UPDATE users SET last_login = '".$date."' WHERE id = '".$_GET['id']."'";
However, on that same page, you want to view the record so you can see what you are editing...
So you will have
PHP:
$query = "SELECT * FROM users WHERE id = '".$_GET['id']."'";

Oh, and the page where you click on the link:
PHP:
<a href = "update.php?id=$id">#<?php echo $id;?></a>
But on this page you will have the following query:
PHP:
$query = "SELECT * FROM users";
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X