Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

PHP Development Software Tool

Status
Not open for further replies.
I'm a PHP/MySql Developer, alot of those automatic php/database programs, create nasty databases with masses of redundant data which makes future queries unworkable.

They are also limited by their programmers forethought, kinda like buying a smartcar and wondering why you can't fit 4 people in it. Majority of them, I'd heard about and read about don't handle joins very well, they virtually don't do regex.

Database Software | PHP MySQL (PHPMagic) is another one.

If its a specific task, it maybe better for you to visit rentacoder or scriptlance and buy in what you need, or find someone you can trade with, to make the basics for you.
 
oh one more thing, when defining your schema for the databases, use prefixes as it will save the hair on your head, for example

table domain
-id
-name
-reg
-exp
-price

table buyer
-id
-name
-email
-tel

table registrar
-id
-name
-website

When you come to work with that, you will end up mixing name and id up for certain, and if you do manage to get software that will do a join, you will have to alias each one, and most software that can do joins odds on, won't have automatic alias ability.

You really should use more like


table domain
-dom_id
-dom_name
-dom_reg
-dom_exp
-dom_price

table buyer
-buy_id
-buy_name
-buy_email
-buy_tel

table registrar
-reg_id
-reg_name
-reg_website

Makes it easy to track and use your data, also makes it easier to expand once you know some php/mysql :)

(sorry after thought post).
 
After 20 or so years working with databases (and looking / optimizing other people's work), unless you are just doing a very simple list into a table, you really need to be designing your database properly and understand a bit about how databases work.

I had a customer recently who was considering a dedicated server for his system as it was so slow, after a few hours consultancy he's now running this on a shared hosting server and handling more than twice the workload and has almost zero impact on the server.

Badly written database applications will quickly get your account noticed by the system admin :(
 
I personally write the bulk of my raw php in zend studio (Zend Studio - The Leading PHP IDE from the PHP Experts - Zend.com), if it need it to look pretty I use dreamweaver (Adobe - Dreamweaver CS3, Web Site Design, Web Page Design, Web Design Software).

I have been known (man I'm gonna look like such a geek), to edit PHP using the notepad/jotter feature on my mobile phone (p910i) by ftp'ing into the server to correct some code while, I was away from home for a week ago.

Puritans will say use vi or notepad or some other crap, but a little help never hurt anyone, and syntax highlighting is worth its weight in gold at times.
 
All our PHP code is done by hand as well. We use the Zend studio suite as well - it's very nice :)
 
The only thing, I miss in Zend is the WYSIWYG view that dreamweaver offers in split view.

Amazing is the word for zend studio :)
 
Anything with a colour coded editor is good, something that will match your "{"'s can help find things when you can't why the wrong bit of code is executing.

As you build things you can then build into a library and re-use next time to save time, after a few similiar sites, the you'll soon have a shopping list of data tables and code routines to pull together.
 
After 20 or so years working with databases (and looking / optimizing other people's work), unless you are just doing a very simple list into a table, you really need to be designing your database properly and understand a bit about how databases work.

I had a customer recently who was considering a dedicated server for his system as it was so slow, after a few hours consultancy he's now running this on a shared hosting server and handling more than twice the workload and has almost zero impact on the server.

Badly written database applications will quickly get your account noticed by the system admin
Amen to that...

First rule of database work... 'thou must normalise thy database to the 3rd normal'
Second rule of database work... 'If you don't understand rule 1, then find out why'.

I still use gVim - with a custom theme - for all my development work. But that's because I am a geek! and learned programming on it. I use a localhost install to check functionality. WAMP is good. Highly recommended as a local test environment.

Never got used to wsywig, but been told dreamweaver is the industry standard.

S
 
Rules of Data Normalization

The key, the whole key, and nothing but the key, so help me Codd

I always imagine some hard ass army drill sarge shouting that :p

Normalisation is the biggest pain my ass since that time i jumped on my bike without the seat in place. :p
 
True... It can lead to some 'interesting' sql queries with convoluted joins. I'm sure that's the reason a lot of OS packages I'v seen have large tables with redundant data. Too hard to normalise and construct queries.

Saying that, there's one thing worse than a badly normalised DB, and that's a badly indexed one... 'EXPLAIN is your friend!'

S
 
My DB is fairly simple:

`id` bigint(20) NOT NULL auto_increment,
`Manufacturer` varchar(255) NOT NULL default '',
`Model` varchar(255) NOT NULL default '',
`Description` text NOT NULL,
`Transmission` varchar(10) NOT NULL default '',
`Engine Capacity` text,
`Fuel Type` text,

for a cars database.

Basically I want a drop down box where you choose the Manufacturer, Model and Description:

e.g. Aston Martin, Vantage, Convertible.

that will then update the main page with data about that car:

fuel consumption, etc.

Can anyone offer me an easy fix?

I have all the data in the DB, I just need to be able to search / show it.

Thanks

Admin
 
Your probably going to normalise that table, into a few other tables to make it more robust.

Are you really looking at something like Insurance companies use ?

Select Make

A list of models comes up.

Select Model

A list of types come up.

Select Style

A list engines come up.

Select Engine Size

Then your going to pull all the information on the selected car out ?

The issue your going to have is, your going to need to ajax it, or submit each box, other wise whats stopping me selecting Porche, Focus, Cabriolet, 6.4 liter.

If i'm understanding it right ?
 
My Ajax is kinda sucky but the rest is easy, I would prob do it using forms at first and then plug ajax in at a later date because I suck at it.

PHP and AJAX MySQL Database Example

That explains the basics.

Change the html form from Select User to

<?php
$query = "SELECT id, manufacturer FROM cars";
$cars = mysql_query($query) or die("Select Failed!");
// We do this untill there is nothing left to do in the select statment.?>
<select name="manu" id="manu">
<option value="<?php echo (isset($_POST['manu'])) ? $_POST['manu'] : ''; ?>" selected="selected"> <?php echo (isset($_POST['manu'])) ? $_POST['manu'] : 'Select Manufactuter'; ?> </option><?php
while ($row = mysql_fetch_array($cars)) {
echo '<option value=\"' . $row['manufacturer'] . '">' . $row['manufacturer'] . '</option>';
}
?>
</select>

Using the above Ajax example you can get an idea.

I havent been home from work long, so just knocked this up, i'll look at something better when I get a mo :)
 
An idea I was thinking of a few years ago for a project, but the developer decided to implement in his own way which was slower, but the project was canned anyway.

Why not create the data for the drop downs as arrays in JavaScript, pop these into pre-prepared include files so that they get cached by the browser and then use JavaScript to populate the dropdowns from the arrays. Make your "add something" script also rebuild the include file.

You then only run the query once per database change, data is only delivered to each customer once and the browser will act as a cache engine for your static data even if the customer goes away and comes back later.
 
Thats how I implent alot of my stuff.

I have files or functions depending on task at hand called say

index.php
makes.inc.php
models.inc.php
spec.inc.php

Index includes a call to makes.inc.php with wildcard query to builds a list like

Alpha
Ford
Porche
Zebra

Then when someone clicks on Zebra it sends a request to models.inc.php?q=zebra which then returns all the models made by zebra.

Stripped
Speckled
Splattered
Shot

Someone then clicks on shot, which queries spec.inc.php?q=shot which then returns a spec sheet.

Thats the basis of Ajax, its just that I suck at Ajax :p

Take a look at the above link, which does EXACTLY near enough what you described, and

Auto-populating Select Boxes with AJAX and MYSQL

does it in a fancy Ajax way of how I do it :)
 
Status
Not open for further replies.

Who has viewed this thread (Total: 1) View details

Who has watched this thread (Total: 3) View details

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

☆ Premium Listings

Sedo - it.com Premiums

IT.com

Premium Members

Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom