ZacCarlson's Profile
Reputation: -8
Shunned
- Group:
- Active Members
- Active Posts:
- 136 (0.53 per day)
- Joined:
- 08-October 12
- Profile Views:
- 1,307
- Last Active:
Jun 11 2013 12:31 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Trying to display two tables side by side but get error
Posted 11 Jun 2013
Do you mean the Plantings.plantOrFlowerName? (Nevermind - see it) Lets try -
In Topic: Trying to display two tables side by side but get error
Posted 11 Jun 2013
What's wrong with line #22? -
In Topic: Trying to display two tables side by side but get error
Posted 11 Jun 2013
This is what I have so far:
<?php require_once("garden_common_db.inc.php") ?> <?php $query = "SELECT Family.family, GeneralCategory.category, PlantOrFlowerName.plantOrFlowerName, Genus.genus, PlantOrder.plantOrder, SeasonCycle.seasonCycle, Tribe.tribe, Plantings.dateOfPlanting, Plantings.location, Plantings.source, Plantings.lightRange, Notes.notes FROM Family INNER JOIN GeneralCategory ON Family.plantOrFlowerName=GeneralCategory.plantOrFlowerName INNER JOIN PlantOrFlowerName ON PlantOrFlowerName.plantOrFlowerName = Family.plantOrFlowerName INNER JOIN Genus ON Genus.plantOrFlowerName = PlantOrFlowerName.plantOrFlowerName INNER JOIN PlantOrder ON PlantOrder.plantOrFlowerName = Genus.plantOrFlowerName INNER JOIN SeasonCycle ON SeasonCycle.plantOrFlowerName = PlantOrder.plantOrFlowerName INNER JOIN Tribe ON Tribe.plantOrFlowerName = SeasonCycle.plantOrFlowerName INNER JOIN Plantings ON Plantings.plantOrFlowerName = Tribe.plantOrFlowerName INNER JOIN Notes ON Notes.plantOrFlowerName = Plantings.plantOrFlowerName";; $result = mysqli_query($link, $query) or die("Error: ".mysqli_error($link)); ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Mom's Garden</title> </head> <body> <h1>Mom's Garden</h1> <table border="1"> <tr> <th>Flower Name</th> <th>Family</th> <th>Category</th> <th>Genus</th> <th>Plant Order</th> <th>Season Cycle</th> <th>Tribe</th> <th>Date Planted</th> <th>Location</th> <th>Source</th> <th>Light Range</th> <th>Notes</th> </tr> <?php while ($record = mysqli_fetch_array($result)): ?> <tr> <td><?php print $record['plantOrFlowerName'];?></td> <td><?php print $record['family'];?></td> <td><?php print $record['category'];?></td> <td><?php print $record['genus'];?></td> <td><?php print $record['plantOrder'];?></td> <td><?php print $record['seasonCycle'];?></td> <td><?php print $record['tribe'];?></td> <td><?php print $record['dateOfPlanting'];?></td> <td><?php print $record['location'];?></td> <td><?php print $record['source'];?></td> <td><?php print $record['lightRange'];?></td> <td><?php print $record['notes'];?></td> </tr> #<?php endwhile; mysqli_free_result($result);?> </table> <form action="insert.php" method="post"> Insert new plant/flower: <input type="text" name="plantname"> Family: <input type="text" name="family"> Category: <input type="text" name="category"> Genus: <input type="text" name="genus"> Plant Order: <input type="text" name="order"> Season Cycle: <input type="text" name="season"> Tribe:<input type="text" name="tribe"> Date:<input type="text" name="date"> Location:<input type="text" name="location"> Source:<input type="text" name="source"> Light Range:<input type="text" name="range"> Notes:<input type="text" name="notes"> <input type="submit" value="Insert"> </form> <form action="delete.php" method="post"> Delete plant/flower: <input type="text" name="deletedplantname"> <input type="submit" value="Delete Record"> </form> <form action="update.php" method="post"> Update which name? <input type="text" name="nametoupdate"> Update new name to: <input type="text" name="newname"> <input type="submit" value="New Name"> </form> </body> </html> -
In Topic: Trying to display two tables side by side but get error
Posted 10 Jun 2013
OK, that's fixed. But why won't it show on my php? It shows in mysql. -
In Topic: Trying to display two tables side by side but get error
Posted 10 Jun 2013
So you are saying I should do:
$sql="INSERT INTO PlantOrFlowerName (plantOrFlowerName) VALUES ('$_POST[plantname]')"; if (!mysqli_query($link,$sql)) { die('Error: ' . mysqli_error($link)); } mysqli_close($link); ?> $sql="INSERT INTO Family (plantOrFlowerName, family) VALUES('$_POST[plantname]', '$_POST[family]')"; if (!mysqli_query($link,$sql)) { die('Error: ' . mysqli_error($link)); } mysqli_close($link); ?>
My Information
- Member Title:
- D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
ZacCarlson hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
ZacCarlson has no profile comments yet. Why not say hello?