prob in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
forgun
Forum Commoner
Posts: 61
Joined: Wed Jan 29, 2003 6:05 am
Contact:

prob in php

Post by forgun »

Code: Select all

<?php
if ($type == "dl") {
   foreach ($kays as $count => $tkay) {
        foreach ($path as $count2 => $tpath) {
			for ($i = 0; $i <= $count; $i++) {
					$qur = "INSERT INTO linkssets (kayword , path , type , ip) VALUES (";
					$qur .= "'" .mysql_escape_string($tkay) . "' , '"  .mysql_escape_string($_SERVER['HTTP_HOST'] .$tpath) . "' , 'dl' , '" .$ip ."')";#the error line no mysql error is show 
					mysql_query($qur) or die (mysql_error());
				}
			}
		}
	}
?>
i try to see what is the prob here and i didnt find i have an error that the data in not pass to the db at all
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Re: prob in php

Post by patrikG »

What exactly did the error-message say?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You might add html-comments to check what should have been added to your database.

Code: Select all

// the error line no mysql error is show
echo '<!-- ', htmlentities($qur), "-->\n";
mysql_query($qur) or die (mysql_error());
These lines will not appear within the rendered document but in the browser's source view, so they do not break down your layout (only if you're trying to send headers afterwards)
Post Reply