Search found 25 matches

by yoji
Sat Jan 03, 2009 6:52 am
Forum: PHP - Code
Topic: ID for post
Replies: 2
Views: 79

Re: ID for post

Wow thanks a million... Didn't knew that one...
by yoji
Sat Jan 03, 2009 5:28 am
Forum: PHP - Code
Topic: ID for post
Replies: 2
Views: 79

ID for post

I am creating this blog. My question is that how can I get the id (which is primary auto) of the post i JUST made??? Now, I can't use WHERE to compare the post itself with the database to get the id... How can I do it??? Take it as this: If you had 3 columns in a table, ID, TITLE,MESSAGE. Where ID i...
by yoji
Mon Dec 29, 2008 2:23 pm
Forum: PHP - Code
Topic: Sessions not working across pages...
Replies: 1
Views: 153

Sessions not working across pages...

I have tried everything... Lmme show you the code first: This is page 1:   <?php session_start(); $_SESSION['name']='dexter'; echo $_SESSION['name']; ?> <a href="page.php">Go to this page</a>   This is page.php:   <?php session_start(); echo $_SESSION['name']; ?>   Session works just fine ...
by yoji
Mon Dec 29, 2008 11:26 am
Forum: PHP - Code
Topic: Session's getting lost?
Replies: 4
Views: 176

Re: Session's getting lost?

I have referred to quite a few resources (including documentation. Which btw is like a physics textbook :p )
Now there's is a new prob: "Undefined index: name" Even though I have double check the "index name".
by yoji
Mon Dec 29, 2008 11:18 am
Forum: PHP - Code
Topic: Session's getting lost?
Replies: 4
Views: 176

Session's getting lost?

Hi, I have tried to solve this prob myself but couldn't, please help me out here.. This is the code:   <?php session_start(); $_SESSION['name']='dexter'; echo $_SESSION['name']; ?>   The above code works just fine... The problem comes when I try to access this associative array in another file. Let'...
by yoji
Mon Nov 24, 2008 5:16 am
Forum: PHP - Code
Topic: Logic help for blog
Replies: 2
Views: 172

Logic help for blog

I am creating a class for blog. One that will go along with any blog. My question is how can I render the posts pagewise? Let's say there are 20 posts and I want 5 to show on each page... Now how exactly should I do it? I don't want to know the SQL or similar.. I just want to know how can I create t...
by yoji
Fri Nov 21, 2008 4:13 am
Forum: Coding Critique
Topic: First try at OOP->Field checker
Replies: 1
Views: 1969

First try at OOP->Field checker

Hiz.. I have tried creating few sites in the past and I always get stuck with problems, and also that I find my self iterating when it comes to the text fields.. You know those sign-up pages. You gotta check user, pass, name length then pass should be valid, then pas.... yada yada yada.. So I create...
by yoji
Tue Nov 18, 2008 6:37 am
Forum: PHP - Code
Topic: Duplicate Data
Replies: 1
Views: 126

Re: Duplicate Data

first off, you need to place the column names..
$query = "INSERT INTO news ('THE_COLUMN1,THE_COLUMN2') VALUES

THE MAIN CULPRIT:
$result = mysql_query($query)or die(mysql_error());

the above won't work... This is causing your double queries...
by yoji
Tue Nov 18, 2008 6:27 am
Forum: PHP - Code
Topic: php readdir encoding
Replies: 5
Views: 1951

Re: php readdir encoding

try removing the extra = from "!==".. Make it "!="
by yoji
Sat Nov 15, 2008 3:47 am
Forum: PHP - Code
Topic: mysql numbering problem
Replies: 4
Views: 188

Re: mysql numbering problem

Actually the number of records AND the data I will be inserting is very small... ANy ways I have figured out a better way: I am going to use ID by counting total records rather than extracting it from a column.. Thanks anyway.
by yoji
Sat Nov 15, 2008 3:26 am
Forum: PHP - Code
Topic: mysql numbering problem
Replies: 4
Views: 188

Re: mysql numbering problem

I have tried using this approach. This time the column is only int.   $idresult = mysql_query("SELECT * FROM links");     while($idrow = mysql_fetch_array($idresult))         {         $id=$idrow['ID'];           }         if($id==NULL)         {             $dbid=1;         }             ...
by yoji
Sat Nov 15, 2008 2:14 am
Forum: PHP - Code
Topic: mysql numbering problem
Replies: 4
Views: 188

mysql numbering problem

hi. I have created this column 'ID' which is primary auto, and auto increasing. The problem is that if I delete any record from database, then the new record will have the 'ID' after the deleted one. Let's say I deleted the first record, now when I add the second record (no records exist) the 'ID' o...
by yoji
Wed Nov 12, 2008 4:42 am
Forum: PHP - Code
Topic: Text editor for blogs/forum
Replies: 1
Views: 71

Text editor for blogs/forum

Hi. I was about to create my own blog. I just wanted to ask about the editor used in most blogs or forums, you know with many editing options. How can I include it in my blog too? And what are they called?
by yoji
Thu Nov 06, 2008 5:54 am
Forum: PHP - Code
Topic: Variable scope problem?!?!?
Replies: 2
Views: 378

Variable scope problem?!?!?

First off, here is the code:   <?php if (isset($_POST['Submit'])) {       //variables     $fName=$_POST['fName'];     $lName=$_POST['lName'];     $email=$_POST['email'];     @ $fp=fopen("$dRoot//fopen//data//entries.txt",'ab');         if (!$fp)     {             echo "Couldn't open t...
by yoji
Tue Oct 28, 2008 6:54 am
Forum: PHP - Code
Topic: OO code not working :(
Replies: 3
Views: 157

OO code not working :(

I just started objected oriented programming. Wrote first code today but it's creating problem... Here's the code   class sqlize {     var $host="localhost";     var $user="root";     var $password="";     function sqlize($databaseName)     {         global $con;       ...