Jump to content

redpedia

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

redpedia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much , it worked now , the problem was that i forgot echo(s) ... i am a noob !
  2. ok i remove it but the problem still remains ....
  3. Hello , i have a strange problem i am trying to populate a combo box from mysql database, here is the code <?php include("functions.php"); mysql_connection(); $sql_query= mysql_query("select category_id,category_name from categories"); ?> <select name="category" id="category"> <option value="Choose">Choose</option> <? while($fetch= mysql_fetch_array($sql_query)) { ; ?> <option value= " <? $fetch[category_id]; ?> " selected="selected"><? $fetch[category_name]; ?> </option> <? } ?> </select> there is no errors but it keeps showing blank records or spaces inside the combo box, i mean i have 3 records now in the table , the combo box just retrieve blank 3 spaces ! , where is the problem please ? [attachment deleted by admin]
  4. I need a script to upload files through ftp and store their path inside mysql Database, now i've found a script use something called Tutorial: FTP Upload via cURL, here is the script , all i need is to get the path from this script and put it inside mysql insert syntax, but i don't know which var because iam still newbie in php , could you please help ?! Here is the script HTML FORM <form action="curlupload.php" method="post" enctype="multipart/form-data"> <div> <label for="upload">Select file</label> <input name="upload" type="file" /> <input type="submit" name="Submit" value="Upload" /> </div> </form> PHP Action <?php if (isset($_POST[‘Submit’])) { if (!empty($_FILES[‘upload’][‘name’])) { $ch = curl_init(); $localfile = $_FILES[‘upload’][‘tmp_name’]; $fp = fopen($localfile, ‘r’); curl_setopt($ch, CURLOPT_URL, ‘ftp://ftp_login:password@ftp.domain.com/’.$_FILES[‘upload’][‘name’]); curl_setopt($ch, CURLOPT_UPLOAD, 1); curl_setopt($ch, CURLOPT_INFILE, $fp); curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile)); curl_exec ($ch); $error_no = curl_errno($ch); curl_close ($ch); if ($error_no == 0) { $error = ‘File uploaded succesfully.’; } else { $error = ‘File upload error.’; } } else { $error = ‘Please select a file.’; } } ?> could you please give the insert syntax for the file path ?
  5. can the post or get be the reason, i mean i use form with post !
  6. <?php UPDATE article SET article_name='cnn around the world', article_author='tom',article_date='2008-05-12', article_post='er' WHERE article_id='' ?> i notice that it didn't dedicate the article_id value
  7. didn't work also ... any thank you very much for your help , i troubled you enough
  8. i've found a bug , its n't id , its article_id ??? even this .. your code didn't show any erorr , but still didn't update the records <?php include "config.php"; //$id = $_GET['id']; $id=mysql_real_escape_string($_POST['article_id']); $article_name=mysql_real_escape_string($_POST['article_name']); $article_author=mysql_real_escape_string($_POST['article_author']); $article_date=mysql_real_escape_string($_POST['article_date']); $article_post=mysql_real_escape_string($_POST['article_post']); $query_update="UPDATE article SET article_name='$article_name', article_author='$article_author',article_date='$article_date', article_post='$article_post' WHERE article_id='$id'"; echo $query; $result=mysql_query($query_update)or die(mysql_error()); ?>
  9. Fatal error: Call to undefined function mysql_real_escape_sting() in C:\AppServ\www\news\update_article_action.php on line 22
  10. sorry but it didn't work ... can you please simplify the code ! , i am still newbie
  11. <? include "config.php"; $id = $_GET['id']; $query_update=mysql_query("UPDATE article SET article_name='$article_name', article_author='$article_author',article_date='$article_date', article_post='$article_post' WHERE id='$id'") or die("can't update"); ?> hi i think there is no erorr in code , but it doesn't update or make anything .. where is the problem please ?
  12. thanks , i think its working Erorr found is i've forget to name the link like edit.php?id= thanks ray
  13. sorry but id didn't work also it gives me this erorr Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\news\edit_outputarticle.php on line 18
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.