BHB
-
Posts
49 -
Joined
-
Last visited
Posts posted by BHB
-
-
Well my form is sticky, drop menus work but does not effect my db; I also don't get errors for empty fields. Guess I am close now.
-
Appears my drop downs are working and the mult queries seem to be happy.. . Might confuse the ids to have one long query. I used a modules foldure from advanced 5 and the redirect path (since my page is an include ). The form path in combination with redirect seem to be causing form not to process and loose the sticky! I am going to step away from the code and work on graphics for a while... Hope subconscious works it out.
-
I am a little confused by this piece of code still. Iff one were to have multiple pull down menus (entering say a new artist really not necc) what changes are made? I like the sticky option and think the radio could be dropped. Each menu has its own query so free result used between each menu? Thanks for any suggestions.
-
Muucho,
Did you get an answer to your question. I have the exact same question. I have passed the 'article_id' to an edit page but editing the form function is still looming from my grasp. I have three books open; there is a hint on page 73 of ECOMM book value="?php echo $_POST,..
pg 272 in php6/MySQL 5 I see using $row from the query,.. all code before this form is what I had come up with. My guess is to drop the form function and just code this page separate? Unless someone has figured out how to adjust the function??? I must sleep on this some but would love some more clues if anyone has any.
One other note, I see if(!empty in eccomm book script but in php6 book form uses if (empty...
thanks
bhb
-
I have entries,..
-
I have downloaded the scripts in case I typed something incorrect but I get this error for View Tasks:
Undefined offset: 0 in C:\wamp\www\programming\tasks\TMP3q6kb137y5.php on line 74
Warning: Invalid argument supplied for foreach() in C:\wamp\www\programming\tasks\TMP3q6kb137y5.php on line 28
What the ??? This is chapter 1... copied script should work, no?
When I go to add task I do not get any other option for parent, just '0' default. Must be a table error?? That was about as simple as it could be too.
-
Live=false?...should be true no?
-
Just wondering if someone can show me what a live config file should look like.. Exactly as in book with exception of paths?
-
Thank you both guess I need to digest your solution further margaux!
-
You may have missed Larry's point. He used an enum field and sent no value from php so admin would not be accessible; admin can only be set in database. But i do see to have a usertype2 table after there is a membership set. More space between allowing a member to be created and heading off to payment makes room for junk data. ???
-
In ex 1 of the book the db table for users = enum. all new users become 'members' and for admin the change is made in db with privileges... Ok, so how would you deal with members having upgrade options. So you have regular member= consumer but consumer can upgrade to pro or corporate or maybe there should be a student option before going to payment. Would you feel safe adding another (secondary) table for user type? ..just trying to find my decision as best way to approach. Not necc for a bunch of code help; just need a good perspective from someone with experience such as yours.
Your books have made such a difference for me! Only been at this since last fall and really helps to have same language (style) spoken in so many books from beginner to advanced. Thank you.
Gg
-
This is general connection question,.. reading all books looking for my mistake.
I'm at a loss,.. 'can not connect to to local MySQL server through socket'
My server has many domain names so I am in a folder under a domain as a testing site. I have correct root path from my host. Using 'localhost' with the user/pass that I set in phpmyadmin with correct permissions,..
site was working fine on local home server,.. so must be a path problem? On suggestions are appreciated.
-
Ok, output is working. I did have an array problem. Not sure exactly what happened but it is working. I split up the description and year; always a chance I would leave out a description but have the year in data so needed to be in two echo's anyway.
Thank You!!!!
-
Hello,
I am having a strange problem. My year is showing up as just first number, so '1997' is '1'.. simple problem I am sure but can't find it. Tried changing my database from 'year' format to 'date and to datetime, but that does not work. In My 'q' I call: DATE_FORMAT(p.year_complete, '%Y'), I change my filed name to AS $year blah blah,.. and then my echo is added in to the painting description:
if (!empty($p_description)) {
echo "<p>$p_description</p><br />Original Painting Completed: {$year['year']}</p>\n";
}
I read on page 163 TIP 'always use MySQL functions to format any dates coming from the database'.
What am I missing?
-
I'm guessing this is a problem in logic. I need to add the image filename/field to the price table and have a default image to hold the position until I load one.
-
grrerror 'page accessed in error' message:
// Get the painting list in this category:
$q = "SELECT m.mult_id, m.painting_id, p.title, p.description_painting, i.image_name
FROM multiple_categories AS m, paintings AS p, images AS i
WHERE m.painting_id=p.painting_id
WHERE m.painting_id=i.painting_id
AND category_id=$cid";
$r = mysqli_query($dbc, $q);
if (mysqli_num_rows($r) >= 1) {
// Print each:
while (list($mult_id, $painting_id, $title, $p_description, $image) = mysqli_fetch_array($r, MYSQLI_NUM)) {
// Link to the product.php page:
echo "<img src=./eithumbs/$image><h2><a href=\"productC.php?mult_id=$mult_id\">$title</a></h2><p>$p_description\n";
} // End of while loop.
} else { // No widgets here!
echo '<p class="error">There are no paintings in this category.</p>';
}
} else { // Invalid $_GET['cid']!
echo '<p class="error">This page has been accessed in error.</p>';
}
-
no, no error. I got images to show up using database to call by filename but images are stored in a folder rather than in database. I just want my thumbnail to show along with the LIST info in code above. Trying one more thing,.. maybe I can figure it out.
-
ok, I hope this is not a stupid question. I am adding thumbnails using a folder for iamges, not the database. I have a table in database for image_name relating to painting_id. I figure this way I can have one folder for thumbs and another folder for full size images; everything presized into folders names the same. No PHP manipulation for image size necc.
I can call the images/thumbs from the folder in two separate queries; but then images grouped at top and list grouped below. When I attempt to call together with painting name, link etc and say I have not yet entered an image it becomes 'angry' and does not list the titles/links of paintings entered. Query does not complete with empty field relation. I've learned a lot in last day and happy to be this far so fast... just if anyone has a thought that is obvious I appreciate it. I feel like I know the answer just can't get it off the tip of my brain.
-
doing the happy dance!!!!
$q = "SELECT m.mult_id, m.painting_id, p.title
FROM multiple_categories AS m, paintings AS p
WHERE m.painting_id=p.painting_id
AND category_id=$cid";
$r = mysqli_query($dbc, $q);
if (mysqli_num_rows($r) > 1) {
// Print each:
while (list($mult_id, $painting_id, $title) = mysqli_fetch_array($r, MYSQLI_NUM)) {
// Link to the product.php page:
echo "<h2><a href=\"product.php?mult_id=$mult_id\">$title</a></h2>\n";
-
I learn best by difficult challenges and so your books/language and manner makes this very easy for me attempt difficult, figuring out the small details as I get scripts to work. So, I got it working your version and mine... except in mine I have referenced a table built on foreign keys with design view of PHPmyadmin. I want multiple categories per item (paintings in my case; will have many colors per painting) and I get the reference ID to show rather than the name. Using the designer in PHPmyadmin allows for easier entry of long names; prevent misspelling using drop down value list; not using SQL command line to enter. I think I just need to study the code a little longer and I'll see it. Maybe use a join rather.
PS I am having a blast! I dream looking for solutions.
-
I did match the ISBN number,.. but sorry to bother everyone. I am crash coursing myself in just last few months. I've actually got 6 of your books Larry and just found the explanation for mysqli instead of mysql in one of the other books. I'm just anxious to get to what I need to do practically and your widget example is very suitable as an example. I'll refrain from asking stupid questions and just keep reading.
BHB
-
hmm,.. MYSQLI_NUM predefined constant. I've been looking at this for a long time and guess I had to finally make a public help request to see it. Shame. Sorry.
-
I am a newbie to PHP. Larry is probably too busy to answer this simple question so I appreciate anyone's help.
I can not follow how 'fcat' and 'fcid' are defined in this header script. In database field name is 'category_id' and 'category'; I can see that category_id becomes fcid and understand adding 'f' to not complicate other queries further down the road. I just don't see where association was made... and it's right here in front of me I am sure.
thanks
BHB
Sticky Forms With Pull Down Menu Options
in PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
Posted
this part look right?
If(isset($_GET[submitted])) {
$url .= ' &submitted=' . urlencode($_GET['name1=question&name2=level&name3=industry']);
}
I am confused about the data. Dropp menu is the value from id (two tables level and industry each have respective id). The final post to db should be the id not the value. So maybe I need to add more values to the URL.