Jump to content

php var_dump bool(false) help


dflow

Recommended Posts

strange :confused: :confused:

 

i want to update ProductDescription

i get the parsed $pdescription it is echoed but it's regarded as empty by var_dump

 

 

<?php
// example of how to use basic selector to retrieve HTML contents
include('../simple_html_dom.php');
$links=array("http://www.example.com/apartments/198.htm");



foreach($links as $page) {
   $phtml = file_get_html($page);

// find all td tags with attribite align=center
foreach($phtml->find('span[id=lblCodiceAppartamento]') as $name){
    echo $name->plaintext.'<br><br>';

}

foreach($phtml->find('span[id=lblDescrizione]') as $pdescription){
    echo $pdescription.'<br><br>';

}



$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("international", $con);

$query=mysql_query("UPDATE products_NEW SET ProductDescription='$pdescription'
WHERE ProductName = '$name->plaintext' AND SupplierID = '38'");

var_dump($query);
//mysql_query("INSERT INTO apartments (name)
//VALUES ('$name->plaintext')");



mysql_close($con);






}





Link to comment
Share on other sites

your query (if it works) is an update query. what do you expect to be returned from an update query?

 

$sql = "UPDATE products_NEW SET ProductDescription='$pdescription'
WHERE ProductName = '$name->plaintext' AND SupplierID = '38'";
$result = mysql_query($sql) or die(mysql_error() ." IN $sql");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.