Search found 236 matches

by minimihi
Tue Apr 24, 2012 12:24 pm
Forum: PHP coding => General
Topic: Recursive Troubles
Replies: 13
Views: 1160

Re: Recursive Troubles

Now that I think, I tried to explain it wrong way =D oh well Call stacking and recursive call is very similar. Recursive call also has depth but it never looses returned value from deepest function. Unlike recursive call, call stacking doesn't return a value till the beginning. Yeah, that would be r...
by minimihi
Tue Apr 24, 2012 12:10 pm
Forum: mySQL & php coding
Topic: Syntax Error?
Replies: 0
Views: 437

Re: Syntax Error?

You're using different variables :oops:
$result = mysql_query($query);
while ($bar = mysql_fetch_array($results)){
by minimihi
Tue Apr 24, 2012 12:03 pm
Forum: PHP General
Topic: extract link from php code
Replies: 0
Views: 430

Re: extract link from php code

Could you be more specific about what and from where to extract?

All I see is HTML and a little of JS, no PHP here.
by minimihi
Tue Apr 24, 2012 11:56 am
Forum: PHP General
Topic: Stor articles in HTML files or in a database?
Replies: 0
Views: 434

Re: Stor articles in HTML files or in a database?

If you're storing html in database it's more convenient to access, update, remove it, but like that size of database get a little bigger as gets database load. In the end, to lessen load, a file catching would have to be added + cron job (to make it more comfortable for user to surf your page). If y...
by minimihi
Tue Apr 24, 2012 11:28 am
Forum: PHP Scripts
Topic: script makes a CSV file. how create?
Replies: 5
Views: 1527

Re: script makes a CSV file. how create?

You need to add headers

Code: Select all

header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="filename_user_will_see_when_try_to_download.csv"'); 
and after those headers
mamandis wrote: a script which all data from my partners I get prints to a screen
 
by minimihi
Tue Apr 24, 2012 11:08 am
Forum: PHP coding => General
Topic: php help
Replies: 2
Views: 740

Re: php help

scotty3281 wrote:One page, no information gets passed through Internet.
Just saying.

That is more comfortable for user. Even if you would need to pass data to PHP, AJAX method would be much better than submitting data "directly".
by minimihi
Tue Apr 24, 2012 10:57 am
Forum: PHP coding => General
Topic: Unable to Login after submit form
Replies: 1
Views: 1348

Re: Unable to Login after submit form

egami meant MAKE SURE, this doesn't involve any configuration (so far).

If file is not readable, you will have to change file permissions.

And how to do it - depends on your file system, but mostly chmod is used
by minimihi
Tue Apr 24, 2012 10:45 am
Forum: PHP General
Topic: Auto Selecting a Value in A Drop Down for Edit
Replies: 0
Views: 397

Re: Auto Selecting a Value in A Drop Down for Edit

You have just to select data from few tables using some sort of connection. One table must contain user information, one clients information (according to your way) and one which would show how user information table elements are connected to client information table Simple sample: Query to select u...
by minimihi
Tue Apr 24, 2012 10:24 am
Forum: mySQL & php coding
Topic: find position in database
Replies: 1
Views: 497

Re: find position in database

That should have been simple for anyone to answer, but seems no one even bothered to do so.
Loop through fetches and check ID in every fetch, when you find ID you where looking for, loop number will be element position.
by minimihi
Tue Apr 24, 2012 10:14 am
Forum: PHP coding => General
Topic: How to make account page directory?
Replies: 3
Views: 731

Re: How to make account page directory?

such technique is handled with "mod rewrite".
it's like, on the browser you would see that you're on http://domain.com/user/nick?feature=mhee but actually script was ran on http://domain.com/index.php
user/nick part would be supplied to script as something like "get" parameters.
by minimihi
Mon Apr 23, 2012 2:55 pm
Forum: mySQL & php coding
Topic: SQL ERROR
Replies: 4
Views: 742

Re: SQL ERROR

If you got code from somewhere,at least analyze it

Error is here:

Code: Select all

$query = "insert into $databasetable values(".$linemysql.",".$donorID.");";
@mysql_query($query) or die('SQL ERROR:'.mysql_error()); 
by minimihi
Mon Apr 23, 2012 1:26 pm
Forum: PHP coding => General
Topic: Recursive Troubles
Replies: 13
Views: 1160

Re: Recursive Troubles

It's nothing strange. That function never returns true , which it gets in deepest call. starts a function reaches call to itself -reaches call to itself --reaches call to itself ---returns true --goes back to the place it left, and continues function till the end. DEEPER FUNCTION RETURNED TRUE but i...
by minimihi
Mon Apr 23, 2012 12:51 pm
Forum: mySQL & php coding
Topic: How do I paginate results from sql database?
Replies: 0
Views: 546

Re: How do I paginate results from sql database?

To find out how many pages there will be. Count all selected elements and divide it by count of elements you will be displaying on single page. Then make algorithm where page number could be any number. e.g.: page 1, page 2, page 3 etc. E.g. for queries: for 1st page: Query select, select 5 elements...
by minimihi
Sun Apr 22, 2012 8:17 am
Forum: MySQL Installation
Topic: table letter case and my.cfg on linux
Replies: 1
Views: 3418

Re: table letter case and my.cfg on linux

Seems easiest way will be to rename tables names on database 8)

Sloved (rofl)
by minimihi
Sun Apr 22, 2012 7:48 am
Forum: MySQL Installation
Topic: table letter case and my.cfg on linux
Replies: 1
Views: 3418

table letter case and my.cfg on linux

Today is my second day that I'm setting up LAMP on my office laptop. On first day I installed Ubuntu and tried to install LAMP but failed since I got some problem with mySQL and PhpMyAdmin. And to addition Ubuntu was lagging to much <_< old laptop. On second day, thats toady, I switched to OpenSUSE ...
by minimihi
Sat Apr 21, 2012 3:20 pm
Forum: PHP coding => General
Topic: Registration Form
Replies: 7
Views: 1648

Re: Registration Form

You just needed to change second if condition, so that it could scope later code <?php if($submit){             $connect = mysql_connect("*****","*****","*****") or die ("Couldn't connect!");     mysql_select_db("*****") or die ("Couldn't find a db!");          $namecheck = mysql_query("SELECT usern...
by minimihi
Sat Apr 21, 2012 3:09 pm
Forum: PHP coding => General
Topic: quick question. Please help!
Replies: 2
Views: 594

Re: quick question. Please help!

file_get_contents() has empty argument. eg.
file_get_contents('')
by minimihi
Sat Apr 21, 2012 11:41 am
Forum: PHP General
Topic: How can it work?
Replies: 2
Views: 1013

Re: How can it work?

If it works, then it means that it's correct :D
by minimihi
Sat Apr 21, 2012 5:33 am
Forum: PHP coding => General
Topic: get the domain name of a website useing includes file
Replies: 0
Views: 455

Re: get the domain name of a website useing includes file

The code which is included in remote servers is executed on your server, so 'HTTP_HOST' , 'SERVER_NAME' will give only your information. Use 'REMOTE_ADDR' to get remote server IP and gethostbyaddr() to get domain name from IP. That should work fine with single domain associated to server, but I don'...
by minimihi
Sat Apr 21, 2012 4:55 am
Forum: PHP General
Topic: Hoping Someone PHP Savy Can Help me
Replies: 4
Views: 986

Re: Hoping Someone PHP Savy Can Help me

Neither I know what is that SBI, nor you decently explain what you did on PHP By the way, it seems you're talking not about programming, but about site administration (no coding involved). As far as PHP is concerned. Just load XML file to PHP and format it's content so that visitors could see it in ...
by minimihi
Sat Apr 21, 2012 2:31 am
Forum: mySQL & php coding
Topic: Hierarchical structure (left-right)
Replies: 1
Views: 920

Re: Hierarchical structure (left-right)

Since I posted a topic asking for help and solved it, here's how I did it. For my problem I had to add generation levels to query, that is depth. SELECT node.ITEM_ID, node.ITEM_NAME, (COUNT(parent.ITEM_NAME) - (sub_tree.depth + 1)) AS depth FROM items AS node, items AS parent, items AS sub_parent, (...
by minimihi
Sat Apr 21, 2012 1:18 am
Forum: PHP coding => General
Topic: foreign key in mysql
Replies: 5
Views: 873

Re: foreign key in mysql

I will repeat what was said in article, which address was posted above.

Don't try to add FOREIGN KEY on table, which type isn't InnoDB. Only InnoDB support foreign keys.
If you're using PhpMyAdmin, you can choose table type when you're creating new one.
by minimihi
Sat Apr 21, 2012 1:11 am
Forum: PHP coding => General
Topic: How to clear a browser page's content...?
Replies: 0
Views: 362

Re: How to clear a browser page's content...?

You can do that with ob_clean()

Reference:
ob_clean()
by minimihi
Sat Apr 21, 2012 1:07 am
Forum: PHP coding => General
Topic: quick question. Please help!
Replies: 2
Views: 594

Re: quick question. Please help!

Then it' same as you would pass string or variable

Code: Select all

echo file_get_contents(the_field('schools'));
// OR
$field = the_field('schools');
echo file_get_contents($field);