New to php and mysql

Sometimes you need a place to chat about stuff, and that's okay, because we're a community. This board is meant just for that, to talk about everything and even your kitchen sink (if you feel so inclined).

mathew edison Mon May 21, 2007 2:17 pm

New to php and mysql

Ok so I got a problem, i'm trying to build my own content management system but I ran into a few problems. I can post data into a database and retrieve it for display on a page but there are two things I need to know.

1) Listing database items with a link to delete
2) retrieving data INTO a form to edit and then save to a database again.

Any help would be hudgely appreceated.

EDIT: (Sorry for my terible spelling)
User avatar

Posts: 459


AgentPhoenix Mon May 21, 2007 2:41 pm

You can retrieve database entries by feeding the results of a SQL query into a loop (for, while, or foreach). Once you're inside the loop, you can create links and set things up to display for each record coming out of the database. SMS uses this a lot, so taking a look through the code you should get a pretty good idea of what's happening.

To put data into a form from the database, you just have to set the field's value equal to the variable you want. If there's nothing in the database, obviously nothing will go there, otherwise, it'll print out whatever is coming from the database. Again, SMS uses this a lot in the administration side of things if you want to get an idea.
User avatar

Posts: 7576


mathew edison Mon May 21, 2007 2:52 pm

So you got no problem if I take the sms apart to see how it works? Ofcourse I won't copy the coding, it's just to give me a idea because i'm trying to start up my own CMS and use it for my fleet. Thx for the help agentphoenix! :)
User avatar

Posts: 459


AgentPhoenix Mon May 21, 2007 3:00 pm

SMS is open source web software which means it's available to you to go in and change things. Open sources software is also the best way to learn that form of coding because you're able to see it in action and then see the code. Anyone is free to poke around SMS and see how things work, the only stipulation is that you can't copy code as that would be a violation of SMS Terms of Use.
User avatar

Posts: 7576


mathew edison Mon May 21, 2007 3:47 pm

Thx for the help once again :)
User avatar

Posts: 459


Cybershark Mon May 21, 2007 6:43 pm

matehw edison wrote:Thx for the help once again :)


And if you have further questions, don't hesitate to ask.

Some basic reference information:

Posts: 942


mathew edison Tue May 22, 2007 11:26 am

I got the website with the "how to make you own CMS" sombody posted on these forums. It was really usefull but the delete section function didn't work like it was supposed to work... Other then that it's a great guide!
User avatar

Posts: 459


matty-vfx Wed May 23, 2007 1:33 am

I may have been the one to have posted that... while I haven't gone through it all step by step, it all seemed fairly comprehensive on the surface without errors - I'm curious as to the error you were getting and the code that was being executed as from your script?
It's a compulsory fact of life that we have to grow old...
...but that doesn't mean we have to grow up

Posts: 385


mathew edison Wed May 23, 2007 11:17 am

Right the upload script worked and I can add the catagories to the database but then when i'm trying to delete them from the database on the edit section page the url shows up action=delete blablabla but the catogory is still there
User avatar

Posts: 459


matty-vfx Fri May 25, 2007 8:54 am

Hmm, odd... first up, do you have php errors turned on? That'll give you a pretty good idea of where the problem lies and what the problem is. Next up, could you copy the MySQL command here that you're using, it might yield some results. And third, just copy and paste the url string that this is working on. Thanks ;)
It's a compulsory fact of life that we have to grow old...
...but that doesn't mean we have to grow up

Posts: 385


mathew edison Fri Dec 05, 2008 6:50 pm

Re: New to php and mysql

Dang it this is an odd post for me. This reminds me of how I started coding. It's actually not that long ago. I'm guessing I picked up on the basics of PHP quickly because I liked it and that Tutorial on how to build a CMS from scratch was really useful even though now I'm also working with CI it should have explained the MVC system. Anyways here is the link once more and I really recommend it to anyone who is starting PHP and Mysql: www.php-mysql-tutorial.com.
User avatar

Posts: 459


AgentPhoenix Tue Dec 23, 2008 11:33 pm

Re: New to php and mysql

We always seem to throw these out, but this is a great one for anyone who knows little to nothing about PHP (or even someone who knows more than a little). It's a great list of stuff and will have you on your way with PHP in no time!

http://nettuts.com/articles/web-roundup ... m-scratch/
User avatar

Posts: 7576


AgentPhoenix Thu Mar 12, 2009 11:33 am

Re: New to php and mysql

For anyone interested in getting started with PHP through a series of screencasts.

http://net.tutsplus.com/videos/screenca ... -into-php/
User avatar

Posts: 7576


AgentPhoenix Wed May 27, 2009 6:54 am

User avatar

Posts: 7576



Next

Return to The Anodyne Lounge

Who is online

Users browsing this forum: No registered users and 1 guest