1,076,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by my3h

Hey, sorry for the post. I got it resolved. I was supposed to use $lastIndex = strrpos($myURL, '/', 0); instead of $lastIndex = lastIndexOf($myURL,'/');.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I am doing like this

$myURL = $_SERVER['REQUEST_URI'];
        $lastIndex = lastIndexOf($myURL,'/');
        $myURL = substr($myURL,0,$lastIndex);
        //echo $myURL;

But nothing is happening. instead of '/' what i can use ... plz help

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I am using $_SERVER['REQUEST_URI'] ; to get the complete URL address, but in that i want to take only the half, example in $_SERVER['REQUEST_URI'] ; i get http://www.mystore.website.com/index.php?fkdsjklfjdskldfd=id...
but i want to take only till http://www.mystore.website.com, how can i do it?

In PHP is there any function called LastIndex and Substing to use? I am confused. Please help me.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Actually only to display am using php tags. there is not any logic. and within php i have used script earlier, but it worked me. i am not getting why this is not happening. Please tell me if any scripts are there to do the required thing.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

i have a dropdown list where i have 3 options like

<tr>
              <td><?php echo $entry_shippingtype; ?></td>
              <td><select name="type">
                  <option value="free">Free Shipping</option>
                  <option value="flat">Flat Rate Shipping</option>

                  <option value="weight">Weight Based Shipping</option>


                </select></td>
            </tr>


            <tr>
            <td><?php echo $entry_shippingamount; ?></td>
            <td><input type="text" name="shippingamount" value="<?php echo $shippingamount; ?>" /></td>
            </tr>

When i select free shipping shippingamount textbox should be disabled. I dont know how to do it with javascript. Can someone help me please.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

var_dump($results);

Hi,
Thanks for replying.
var_dump($resultViewed); , before forloop, is getting all the data properly. But inside the loop i.e var_dump($results); is getting only one(1st) data, not all the data. I dont know why this is happening. Do i need to put forloop or how can i correct it :(

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I am looping the data and displaying it from the database. But only one data set is displaying in the loop. I dont now where i am doing wrong. Here is my code. Please help me

$resultViewed = $this->model_report_product->getMostViewed();
        $stringResult ="var data= google.visualization.arrayToDataTable([ ['Product', 'Views'],";

     foreach($resultViewed as $results)
     {               
                 $stringResult = $stringResult . "['".$results['name']."',".$results['quantity']."],";

     }
     $stringResult .= "]);";

    $this->data['Viewed'] = $stringResult;  
my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Here is my code, i tried like this. But nothing is getting displayed. I am not getting how to loop it

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          <?php 
          $stringResult;
          $i = 0;
          $sql = "select * from product inner join product_description on product.product_id = product_description.product_id order by product.viewed desc limit 10";
          $results1 = $this->db->query($sql);
          //for($i=0; $i<10; ++$i)
          {
          $stringResult .= "data[" .$i. "] = { label:" .$results['name'].", data: ". $results['quantity'] ."}";
           $i++;

         // foreach($data as $v){
           // echo ",['{$name}'],{$count}]\r\n";
            return $stringResult;
          }
          ?>
        ]);

        var options = {
          title: 'My Daily Activities'
        };

        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>

Suggest me where i am doing wrong and how to correct it.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Yes. its in MySql database and the strusture is like this

CREATE TABLE `product` (
  `product_id` int(11) NOT NULL AUTO_INCREMENT,
  `model` varchar(64) COLLATE utf8_bin NOT NULL,
  `sku` varchar(64) COLLATE utf8_bin NOT NULL,
  `upc` varchar(12) COLLATE utf8_bin NOT NULL,
  `location` varchar(128) COLLATE utf8_bin NOT NULL,
  `quantity` int(4) NOT NULL DEFAULT '0',
  `stock_status_id` int(11) NOT NULL,
  `image` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `manufacturer_id` int(11) NOT NULL,
  `shipping` tinyint(1) NOT NULL DEFAULT '1',
  `shippingamount` varchar(50) COLLATE utf8_bin NOT NULL,
  `price` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `points` int(8) NOT NULL DEFAULT '0',
  `tax_class_id` int(11) NOT NULL,
  `date_available` date NOT NULL,
  `weight` decimal(15,8) NOT NULL DEFAULT '0.00000000',
  `weight_class_id` int(11) NOT NULL DEFAULT '0',
  `length` decimal(15,8) NOT NULL DEFAULT '0.00000000',
  `width` decimal(15,8) NOT NULL DEFAULT '0.00000000',
  `height` decimal(15,8) NOT NULL DEFAULT '0.00000000',
  `length_class_id` int(11) NOT NULL DEFAULT '0',
  `subtract` tinyint(1) NOT NULL DEFAULT '1',
  `minimum` int(11) NOT NULL DEFAULT '1',
  `sort_order` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `viewed` int(5) NOT NULL DEFAULT '0',
  PRIMARY KEY (`product_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=56 ;

In this i want to display top 10 most viewed products in pie chart format.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

What i shopuld put in my foreach or while loop. please suggest me

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi thanks for the replay. I went through this. But i did not understand how to use it. Actually i have top10 products in 1 column and its name , i have to display these two in pie. I dont know know how to relate to this with my data. Can u please explain me :(

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

i want to create a pie chart in my website by taking values from database. I should display the top 10 most purchased product in the form of pie chart in my website. But i dont know how to do it. I have no clue how to start.

Please someone help me in this.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

I have two files, ApplicationRegister.php and UserRegister.php
In ApplicationRegister.php the user fill the details and submit the form to database, it redirects to UserRegistration.php.

In UserRegistration.php, User fills up the form and save the data to the lastest inserted id.
I have used mysql_insert_id() to get the last inserted id, but its not working.

I did like this in my UserRegistration.php

<?php
                 include('connect.php');

                $id = mysql_query("select last_insert_id()"); 



              echo $id;
              $sql = "select * from ApplicationRegister where application_id= $id" ;
              $result = mysql_query($sql) or die (mysql_error());
              while ($row = mysql_fetch_assoc($result))

                {
              echo "<table width='85%' cellpadding='4' border='0'>" ;
              echo "<tr><td> <h3> Company Name:   </h3></td> <td>" . $row['CompanyName'] . "</td> </tr> ";

                  echo "</table>";             

                }

When i say echo $id; I get result as 0.

Actually i am inserting data in ApplicationRegister.php like this

$sql = "INSERT INTO ApplicationRegister (CompanyName, CompanyEmail, CompanyContact, CompanyAddress, RegistrationType, ApplicationPlan, ApplicationStatus, CreatedDate) VALUES ('$CompanyName', '$CompanyEmail', '$CompanyContact', '$CompanyAddress', '$RegistrationType', '$Plans', '$Status', NOW() )";
$result = mysql_query($sql) or die(mysql_error());


//if(isset($plan == "trail"))
if($plan == "trail")
{

header("Location: userRegister.php");
}
else
{
    header("Location : PaymentGateway.php");
}

This data will be submitted to the ApplicationRegister table. after submitting user will redirect to user registration page, there i wan to get the last inserted id from the ApplicationRegister table. So the insert command will be in the previous page.
How can i solve this?
Please help me.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I want to display my database records in <ul> <li> format. I have using a free template to design my front end. I am reading database data like this

while ($row = mysql_fetch_assoc($result)) {
    $categoryname = $row['category_name'];
    }

and within the loop i have to display records like this

<li class="odd"><a href="services.html">Processors</a></li>
         <li class="even"><a href="services.html">Motherboards</a></li>
        <li class="odd"><a href="services.html">Processors</a></li>
        <li class="even"><a href="services.html">Motherboards</a></li>
         <li class="odd"><a href="services.html">Desktops</a></li>
        <li class="even"><a href="services.html">Laptops & Notebooks</a></li>
         <li class="odd"><a href="services.html">Processors</a></li>
         <li class="even"><a href="services.html">Motherboards</a></li>
        </ul>

i am not able to display like this. please help me...

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I am designing a site something like http://buildabazaar.com and i do not know how user selection of themes to design. When user logs in and trying to build a store he will select a theme out of 5, i don't know how to do it.

Anybody knows how to do it and any source code is there to do it. Please help me.

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hey thanks a ton! it worked for me... thank you

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hello somebody can help me in this

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

I want to have multiple selection checkbox in my website, where user can check for the multiple options.

But for checkbox i should get the data from the database table.

$query2 = "select * from Products where CategoryID = '$CategoryName' ";
 mysql_query($query2) or die(mysql_error());
 $array = array();

while($row = mysql_fetch_assoc($query2)){
$array[] = $row;}

I dont know is this the right way. but after this i dont know what to do. Please help me with the script . thanks

my3h
Light Poster
27 posts since May 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.1866 seconds using 2.59MB