
ram4nd
Members-
Posts
461 -
Joined
-
Last visited
Everything posted by ram4nd
-
even if there are not then you can make 1 yourself
-
or use iframes
-
To display into input text box as pre-filled. You just have to put your sting in value attribute. <INPUT type="textbox" value="This will be displayd">
-
use '' instead of "";
-
There is something wrong with this: $q = "SELECT * FROM `tests`";
-
or you could pass on data with POST method, tere are hidden fields you know.
-
[SOLVED] set a session when you use header redirect?
ram4nd replied to aebstract's topic in PHP Coding Help
What are you planning to do, i am sure that there is easyer way to do that. -
[SOLVED] set a session when you use header redirect?
ram4nd replied to aebstract's topic in PHP Coding Help
Well if the header is activted then it redirects you to login.php, so you have to put the code there. -
Yes. But use tinyint to hold the value. Checked is 1, unchecked is 0 or something. I thing there is no true/false type columns in mysql.
-
Shows couple of errors, I think if I copye my sql code to here than that's enought. function doQueryA($query) { $this->doConnect(); $result = mysql_fetch_assoc(mysql_query($query, $this->connect)); $this->doDisconnect(); return $result; }
-
I need to get some rows from mysql table. I have 2 tables: categories and subcategories. I need to get categorie and subcategories what are linked with that catagorie. I have table where are: subcategorie name and categorie_id. I wonder how can I get all those subcategories. When i tryed i got only the first subcategorie name. This code takes categore names and prints them all. $mysql = new mysql(); $num_rows1 = $mysql->doQueryC('SELECT * FROM category'); for($i = 0; $i <= $num_rows1; $i++) { $cat = $mysql->doQueryA('SELECT name FROM category WHERE id = ' . $i); echo $cat['name'] . '<br>'; }
-
Umm, ok it is not associated. It takes data sepperately from sql tables. Like in the post what i did before this.
-
Umm, what do you mean by table setup? Sql table setup?: category - id name subcategory- id name category_id
-
Ok yes, that is right. If I want to put subcategories into categories then i have to do?: array_merge($categories, $subcategories)
-
I would like to create a multidimensional array. Whith 2 existing arrays. Just put them together in 1 array. Theese are my arrays: $results1 = $mysql->doQueryA("SELECT name FROM category_id"); $results2 = $mysql->doQueryA("SELECT name FROM subcategory_id");
-
All i had to do was to change my sql class code function like this: function doQuery($query) { $this->doConnect(); $result = mysql_fetch_row(mysql_query($query, $this->connect)); return $result[0]; } I am useing PHP 5. Ok basically I need a good link from wher i could learn about php classes. Because just when I thought that I am getting that classes thing then this showed up.
-
Well then do a little class and test it, you wont belive your eyes.
-
Ok I added it, still nothing. There is 1 value in my db. Maybe the query is wrong?. I also repared my conection class: <?php class mysql { var $db_host, $db_name, $db_user, $db_password, $connect, $select, $query, $result; function doConnect() { require_once('../database_settings.php'); $this->connect = mysql_connect($this->db_host, $this->db_user, $this->db_password); $this->select = mysql_select_db($database_name, $this->connect); if($this->connect) return true; else return false; } function doQuery($query) { $this->doConnect(); $this->result = mysql_query($query); return $this->result; } function doDisconnect() { mysql_close($this->connect); } } ?> But that is not the reason why it doesn't work, 9three.
-
Hmm, I am not getting it to work: <?php require_once('mysql_class.php'); class box { var $link_id; function name($link_id) { if(is_numeric($link_id)) { $mysql = new mysql(); $query = 'SELECT name FROM links WHERE id = ' + $link_id; $return = $mysql->doQuery($query); echo $return; } } } $box = new box($mysql); echo $box->name(1); ?>
-
Do I need to make var $mysql, in the beginning of the "otherClass" class?
-
require_once('../database_settings.php') This code is in that: <?php $this->db_host = "localhost"; $this->db_name = "****"; $this->db_user = "****"; $this->db_password = "*******"; ?> But still how can I use my sql connection class in some other class. Is there something to do with parent and child classes?
-
How can I use 1 mysql connection class in other class? Sql connection class: <?php class mysql { var $db_host, $db_name, $db_user, $db_password, $connect, $select, $query; function doConnect() { require_once('../database_settings.php'); $this->connect = mysql_connect($this->db_host, $this->db_user, $this->db_password); $this->select = mysql_select_db($database_name,$connection); if($this->connect) return true; else return false; } function doQuery($query) { $this->doConnect(); if(mysql_query($query, $this->connect)) { $this->disconnect(); return true; } else { $this->disconnect(); return false; } } function doDisconnect() { mysql_close($this->connection); } } ?>
-
I need to make rating, at 5 point system, and hold data in msql table. Is it better to make 1 column for rating and use substr to seperate the numbers or to make seperate coumns, 1 or eatch.
-
If I have 3 folders system, control and view. Control and view folders are in system folder. How can I include stuff from control folder to view folder?