Jump to content

Ezio

Members
  • Posts

    42
  • Joined

  • Last visited

About Ezio

  • Birthday 04/04/1989

Ezio's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hey guys, I have a base 64 encoded data of a video and i need to save it to the server, and view it later. How do i do that...i know how to do that for images..but for videos i have no idea..any help?
  2. Ezio

    Yii help..

    somewhat achieved it: echo Yii::app()->user->getFlash('successmsg');echo CHtml::link('Login Here', array('site/login'));
  3. Ezio

    Yii help..

    How do i display a message in yii with a link using "setflash" in my controller it is: Yii::app()->user->setFlash('index','Password Reset Successful click here to login'); and in my view: echo Yii::app()->user->getFlash('index'); what i want to do is the "click here" text would be a link to the login page(site/login).. ...any ideas??
  4. so should that be the practice from now on, writing the ip instead of localhost..??
  5. That means instead of "localhost" i should write the ip address of my database, whatever it might be..?? (so should that be the practice, writing the ip instead of localhost).
  6. Yes, that worked. But isn't localhost the same as 127.0.0.1 ?
  7. Hey guys, here is the problem that i am having, i am connecting to the server using these lines: $link = mysql_connect('localhost', 'username', 'password');if (!$link) { die('Not connected : ' . mysql_error());} it shows the following error: Not connected : No connection could be made because the target machine actively refused it. what am i doing wrong..??
  8. will try your way and see if it works :-)
  9. it does not shows an error, it just shows a blank page when i print_r the array...so there must be some error in my code... & i have removed the errors that you said still with no luck :-(
  10. I did that something like this: $category_data = array();while ($row = mysql_fetch_object($category_query)) { $category_data[] = array( "category id" => $row->category_id, "category name" => $row->category; ); $sub_query = mysql_query("SELECT * FROM subcategories WHERE category_id ='".$row->category_id."';"); $num_subcategory = mysql_num_rows($sub_query); if($num_subcategory > 0){ while ($sub_row = mysql_fetch_object($sub_query) { $subcategory_id[] = $sub_row->subcategory_id; $subcategory_name[] = $sub_row->subcategory; } } then i have to take it into $category_data[ ] array..that is where i get the error..
  11. yes i have that. where from i am SELECTING the values from sub-categories
  12. @inglome every category has a sub category, i want the category id and then run the select query to find all the subcategories inside each categories and then save it to an array.
  13. i have 3 tables in mysql categories, subcategories, values. now i want to get the values from categories table then count the number of values returned if it is greater than 0 then i fetch the category id from the categories table using while loop, next i check if the subcategory table has any data with the category id that i got from previous table if number of values is greater than 0 then i fetch the subcategory id from the subcategories table using while loop, now again i check the values table, if it has any data with subcategory id, if it is greater than 0 then i fetch all the values... my code looks something like this... $category_query = mysql_query("SELECT * FROM categories"); $num_category = mysql_num_rows($category_query); if($num_category > 0){ while ($row = mysql_fetch_object($category_query)) { $category_id[] = $row->category_id; $category_name[] = $row->category; $sub_query = mysql_query("SELECT * FROM subcategories WHERE category_id ='".$row->category_id."';"); $num_subcategory = mysql_num_rows($sub_query); if($num_subcategory > 0){ while ($sub_row = mysql_fetch_object($sub_query) { $subcategory_id[] = $sub_row->subcategory_id; $subcategory_name[] = $sub_row->subcategory; } for ($j=0; $j < $num_subcategory; $j++) { $subcategory_data[] = array("subcategory id"=> $subcategory_id[$j]); } } } for($i=0; $i<$num_category; $i++){ $category_data[] = array("category id"=>$category_id[$i], "category name"=>$category_name[$i],); } i want to get the subcategory_data[] into category_data[]...........i cannot figure this out.. :-(
  14. Ezio

    Need Help Here..

    Got it...thanks :-)
×
×
  • Create New...