
ripcurlksm
Members-
Posts
17 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
ripcurlksm's Achievements

Newbie (1/5)
0
Reputation
-
Hello Several times I have tried to setup a configurable product within my Magento store (v 1.3.2.4), I followed the instrustions from the tutuorial and also logged into the demo store to compare it to my store. At simplest, I am trying to create a tee shirt where there are two colors and two sizes. I created a "Shirt" attribute set that has "shirt_color" and "shirt_size" attributes. These attributes are global, dropdowns and configurable. I create a new product and use the "Shirt" attribute and create several "simple" tee shirt products that are 'enabled' with no visibility (also tried it as visible). Once my 'simple' tee shirt products are made, I create a 'configurable' tee shirt product and associate the simple products with the product, as well as making sure this product is enabled with its visibility set to search, catalog. So I do all this, I see my Tee shirt product, but I dont see the dropdown menus to pick "color" and "size". After restarting and doing this several times I wanted to ask. Also, could it be that I have to add or tweak the template to show a dropdown menu? Just trying to think about all options. Here is a (long) screen shot of all the settings. http://ksm.fm/misc/ss-cart-help.jpg
-
Thanks!
-
Can anyone help me figure out why this MySQL query is not returning any results when a three-letter search or smaller is tried (ie- "red" or "cat") This search is suppose to be a VERY BROAD keyword search if anyone can suggest an improvement I would appreciate it: SELECT u.id , u.username , p.user_id , p.report_id , r.id , r.company , r.description , r.market1 , r.market2 , r.market3 , r.market4 , r.market5 , r.market6 , r.location , r.date_year , r.date_month , r.source , r.video , r.audio , r.pp , r.execsum , r.report_url , r.exec_url FROM user as u INNER JOIN user_reports as p ON p.user_id = u.username INNER JOIN emt_report as r ON r.id = p.report_id WHERE username = '$username' AND MATCH(r.company, r.description, r.market1, r.market2, r.market3, r.market4, r.market5, r.market6, r.source) AGAINST ('%$P_search*%' IN BOOLEAN MODE) ORDER BY date_year DESC, date_month DESC, company ASC
-
Maybe I need help with my MySQL query? I need to query one user permissions table, get the results and match them up with the report_id's of another table. My query needs to look something like this: [code=php:0] SELECT * FROM emt_report, user_reports WHERE user_reports.user_id = '$username' AND user_reports.report_id = emt_report.report_id; [/code] Here is my database schema: [code] emt_report =============================== id | title | company =============================== 1 | Green | Crayola 2 | Red | Bic 3 | Blue | Papermate user_reports =========================== user_id | report_id =========================== Bob | 1 Bob | 2 Sam | 1 Sam | 3 [/code] [B]My database query from my first post, using the table join, works fine, but is there a cleaner way to write it?[/B] This is frustratingly! ARR :sick:
-
Ok so there is problem with my MySQL search query. I modified my MySQL query to simply pull all rows and the pagination works fine. This is odd that it returns the right results only for the first page.. [code=php:0]$query = "SELECT * FROM emt_report ORDER BY date_year DESC, date_month DESC, company ASC";[/code] Anyway how can I fix/troubleshoot my MySQL query, I am combining and querying three tables so that users get access to the proper data. How can I simplify my MySQL query and still get the correct results?
-
I have a MySQL result page from a table join which takes all of the users permissions and prints the reports for that user. There are lots of reports, so i have a search script, which limits the results per page and adds paginated numbers at the bottom. This is working fine for the first page of results, however when I click the other pages it shows the page without the MySQL query... its pretty much blank with the exception of the template. Why isnt this working on the other paginated pages? All the variables are there in the URL string at the end of my script... [B]member_market.php[/B] [code=php:0] <?php session_start(); // Starts the session $username = $_SESSION['valid_user']; include('scripts.inc.php'); header("Cache-control: private"); // IE6 Fix. Why? Because it's rubbish class Pager { function getPagerData($numHits, $limit, $page) { $numHits = (int) $numHits; $limit = max((int) $limit, 1); $page = (int) $page; $numPages = ceil($numHits / $limit); $page = max($page, 1); $page = min($page, $numPages); $offset = ($page - 1) * $limit; $ret = new stdClass; $ret->offset = $offset; $ret->limit = $limit; $ret->numPages = $numPages; $ret->page = $page; return $ret; } } dbConnect(); // get the pager input values $P_market = $_GET['market']; $page = $_GET['page']; $limit = 50; $result = mysql_query("select count(*) from emt_report"); $total = mysql_result($result, 0, 0); // work out the pager values $pager = Pager::getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; // use pager values to fetch data $query = "SELECT u.id , u.username , r.id , r.company , r.description , r.market1 , r.market2 , r.market3 , r.market4 , r.market5 , r.market6 , r.location , r.date_year , r.date_month , r.source , r.video , r.audio , r.pp , r.execsum , r.report_url , r.exec_url FROM user as u INNER JOIN user_reports as p ON p.user_id = u.username INNER JOIN emt_report as r ON r.id = p.report_id WHERE username = '$username' AND MATCH(date_year, date_month, market1, market2, market3, market4, market5, market6) AGAINST ('$P_market' IN BOOLEAN MODE) ORDER BY date_year DESC, date_month DESC, company ASC LIMIT $offset, $limit"; $result = mysql_query($query); // use $result here to output page content echo 'You are viewing '.$limit.' results from '.$total.' reports.'; echo '<table width="699" border="0" cellspacing="0" cellpadding="4">'; while($row = mysql_fetch_assoc($result)) { $company = $row['company']; $description = $row['description']; $market1 = $row['market1']; $market2 = $row['market2']; $market3 = $row['market3']; $market4 = $row['market4']; $market5 = $row['market5']; $market6 = $row['market6']; $location = $row['location']; $date_year = $row['date_year']; $date_month = $row['date_month']; $source = $row['source']; $video = $row['video']; $audio = $row['audio']; $pp = $row['pp']; $execsum = $row['execsum']; $report_url = $row['report_url']; $exec_url = $row['exec_url']; print("<p><b>$company</b><br><i>$description</i> // OTHER VARIABLES LEFT OUT FOR SIMPLICITY </p>"); $rank++; } // ---------------------------------------------------------------- // Below prints pagination in the footer (NEED HELP HERE) !! // ----------------------------------------------------------------- // output paging system (could also do it before we output the page content) if ($page == 1) // this is the first page - there is no previous page echo "<<"; else // not the first page, link to the previous page echo "<a href=\"/emt/test/member_market.php?page=" . ($page - 1) . "\"><<</a>"; for ($i = 1; $i <= $pager->numPages; $i++) { echo " | "; if ($i == $pager->page) echo "$i"; else // This is where I think the problem is happening, either this page isnt passing the right variables or something, but all of the needed variables are in the URL. "$P_market" is pulled for the MySQL query and "$i" is pulled for the page numbers. echo "<a href=\"/emt/test/member_market.php?market=$P_market&page=$i\">$i</a>"; } if ($page == $pager->numPages) // this is the last page - there is no next page echo ">>"; else // not the last page, link to the next page echo " <a href=\"/emt/test/member_market.php?market=$P_market&\member_market.php?page=" . ($page + 1) . "\">>></a>"; ?> [/code] Why isnt page two, three, four, etc of the pagination working but the first page is?
-
I found this perl script, but how do I implement it? [code] #!/usr/local/bin/perl # Convert rss to text - rss2txt.pl # # Usage : rss2txt.pl <RSS file> > textfile.txt # # Author : Kyo Nagashima # E-Mail : [email protected] # URL : http://hail2u.net/ # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. use strict; die "Usage: rss2txt.pl <RSS file> > textfile.txt\n" unless @ARGV == 1; use Jcode; use XML::RSS; use LWP::Simple; my $rss = new XML::RSS; my $j = new Jcode; my $content; my $text; my $arg = shift; if ($arg =~ /http:/i) { $content = get($arg); die "Error: Cannot find $arg\n" unless $content; eval { $rss->parse($content); }; die "Error: Cannot parse $arg\n$@\n" if $@; } else { $content = $arg; die "Error: Cannot find $arg\n" unless -e $content; eval { $rss->parsefile($content); }; die "Error: Cannot parse $arg\n$@\n" if $@; } my $chname = &trim($rss->{'channel'}->{'title'}); my $chlink = &trim($rss->{'channel'}->{'link'}); my $chdesc = &trim($rss->{'channel'}->{'description'}); $text .= qq|$chname\n|; $text .= qq|$chlink\n|; $text .= qq|$chdesc\n|; $text .= qq|\n|; for my $item (@{$rss->{'items'}}) { my $itemname = &trim($item->{'title'}); my $itemlink = &trim($item->{'link'}); my $itemdesc = &trim($item->{'description'}); $text .= qq|$itemname\n|; $text .= qq|$itemlink\n|; $text .= qq|$itemdesc\n|; } print STDOUT $j->set(\$text)->sjis; exit; # ---------------------------------------------------------------------------- # sub trim{ my $value = $_[0]; if ($value) { $value =~ s/^\s+//; $value =~ s/\s+$//; } return $value; } [/code]
-
I am familiar with parsing XML feeds and printing them using PHP. However I need to find a way to print/save the XML contents to a .TXT file. Something like this: somefile.txt ----------------------- <tr><td><a href='#'>Link 1</a></td></tr> <tr><td><a href='#'>Link 2</a></td></tr> <tr><td><a href='#'>Link 3</a></td></tr> <tr><td><a href='#'>Link 4</a></td></tr> <tr><td><a href='#'>Link 5</a></td></tr>
-
I have a simple MySQL database of reports which contains the company's name, description and a URL linking to that companies report which is either a .PDF or .PPT file (PowerPoint slide). I have a PHP search page to query the MySQL database, but is it possible to also include the PHP search to look in a specific directory and sort through .PDF text and PowerPoint slides and return keywords? Regards, Kevin
-
I found a simple code to pass the values of each checkbox and pass their values onto the next page. Now that the checked values are passed to the next page, how do I write these new checkbox values into the table for each returned value? Here is the code that prints the form and checkbox and also passes it on to the next page: [code] <form name='form1' method='post' action='editsubscriber3.php'> <? dbConnect(); // This gets all of the reports so that the admin can set permissions for individual reports $sql = "SELECT * FROM emt_report ORDER BY date_year DESC, date_month DESC, company ASC"; $result = mysql_query($sql) or user_error("mysql error " . mysql_error()); $rank = 1; while($row = mysql_fetch_assoc($result)) { $id = $row['id']; print("[B]<input name='$id' type='checkbox' value='$id'>[/B]"); $rank++; }[/code] Here is the second page which pulls each checked value and prints it on the page. [B]What I need to do instead of print is to write to the database the user id and checkbox value for every checkbox. How do I write an SQL array to insert a new row for each checked value? [/B]Here is the code for the second page: [code] foreach ($_POST as $key => $value ) // --- HOW DO I PRINT AN SQL STATEMENT HERE TO WRITE A NEW ROW FOR EACH RETURNED CHECKBOX VALUE? --- echo "$key <br>"; [/code] How do I write the checkbox values into the database? Do I use an array to write an SQL statement for each result? Suggestions? I know it needs to look something like this, but executed each time there is a returned value: $sql = "INSERT into user_reports VALUES ('$user' , '$key')";
-
Doesn't $buf equal two values? Already set through: $buf[] = sprintf('(%d, %d)',[b] $userid, $id[/b]);
-
I am trying a set of different code that I am close to getting running but I keep getting an error with the following: [QUOTE]Warning: Invalid argument supplied for foreach() in /home/content/l/s/i/lsintelligence/html/emt/admin/editsubscriber3.php on line 75 insert into user_reports (user_id, report_id) values[/QUOTE] [B]Here is the code that prints the form checkbox's:[/B] [CODE] <form name='form1' method='post' action='editsubscriber3.php'> <? dbConnect(); // This gets all of the reports so that the admin can set permissions for individual reports $sql = "SELECT * FROM emt_report ORDER BY date_year DESC, date_month DESC, company ASC"; $result = mysql_query($sql) or user_error("mysql error " . mysql_error()); $rank = 1; while($row = mysql_fetch_assoc($result)) { $id = $row['id']; print("<input name='reportbox[]' type='checkbox' value='$id'>"); $rank++; } ?> [/CODE] [B]Here is the page that handles receiving the data and writing to the database.[/B] [CODE] <? $user = $_GET['user']; // --------THIS LINE BELOW IS THROWING THE ERROR -------- $buf = array(); foreach ($_POST['reportbox'] as $reportbox) { $buf[] = sprintf('(%d, %d)', $userid, $id); } echo dbConnect(); echo $sql = "insert into user_reports (user_id, report_id) values " . implode(",\n ", $buf); ?> [/CODE] What am I doing wrong? I kept testing and modifying but I cant get this error to stop... :sick:
-
I have a login system for users to get reports.... On the backend, I have an admin function which allows the admin to set privileges for each user, so that the user only gets the reports they purchased. In the admin section, a series of checkboxes appear for each report. I need to gather this data and write it to the database. [B]In short, I need is to get a JavaScript function that takes all the reports that have a checked box, and then write them into the permissions table of the database.[/B] How do I pass the values of each checked box from JavaScript, then pass it to PHP to write an SQL statement for each entry, for example here is what I would need to transfer from checkbox's with the value of 200, 322, and 505 for user with the user_id of 1. PERMISSIONS TABLE ------------------------ user_id | report_id ------------------------ 1 | 200 1 | 322 1 | 505 JavaScript to PHP to MYSQL... any suggestions?
-
I have three tables set up: user, reports & permissions. I need some help in executing a SQL query and I am having a tough time getting the right results. [B]Summary:[/B] I have a login setup so that a user can login and view reports that they have permission to see. I need the SQL statement to get the user's id, then select all of the rows in the "permissions" table where there id is present AND get the "report id" associated inside that table, THEN select all of the rows in the "report" table that have the "report id" from the previous query. [B] Here is my database schema:[/B] [CODE] user ================== id | username ================== 1 | bob 2 | john reports =============================== id | title | company =============================== 1 | Green | Crayola 2 | Red | Bic 3 | Blue | Papermate permissions =========================== user_id | report_id =========================== 1 | 1 1 | 2 2 | 1 2 | 3 **So Bob would get "Green" and "Red" and John would get "Red" and "Blue"** [/CODE] [B]Here is my incomplete SQL query. I still need to reference the permissions table and I am really lost on this one.[/B] [color=red]SELECT reports.* FROM user, report WHERE user.id = reports.id;[/color] Can anyone suggest a correct query?
-
Database Design and Permissions questions
ripcurlksm replied to ripcurlksm's topic in PHP Coding Help
Didnt I state that in my first question using a '0' or '1'?