Jump to content
php.lv forumi

Kļuda


FT3

Recommended Posts

vai kads varetu man pateiks kas ši ir pa kļudu ?

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, text) VALUES ('1', '1', 'aaaa')' at line 1

 

 

kods ir tads !

<?function add(){ ?>

<form action="" method="POST" >

<textarea  class="commFl" rows="8" cols="30" name="text"></textarea>
<input type="submit" name="aiziet" value="Pievienot!">

</form>
<?}

if ($_POST['aiziet']) { 

$id = $_GET['id'];
$from = $_SESSION['wID'];
$text = $_POST['text'];

if (($text != "")) { ?>

<b>Done!</b>
<?
mysql_query("INSERT INTO message (id, from, text) VALUES ('$id', '$from', '$text') ") or die(mysql_error());
}}else{add();}
?>

Link to comment
Share on other sites

Kļuda

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\includes\message.php on line 4

 

kods

<?php
$result = mysql_query("SELECT * FROM messages WHERE to = '{$_SESSION['wID']}' ORDER by id LIMIT 1");

while($row = mysql_fetch_array($result))
 {
 echo $row['from'] . " " . $row['text'];
 echo "<br />";
 }
?>

Link to comment
Share on other sites

hmm uzrada šo ;/

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to = '1' ORDER by id LIMIT 1' at line 1

 

palidziet vel šo plizzz , vairs jautajumu nebus ;/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...