Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:53 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Post Web Data and mySQL - strange info returned
PostPosted: November 2nd, 2013, 9:21 pm 
Offline

Joined: December 22nd, 2004, 10:00 am
Posts: 29
Opus: Opus Pro 7.5
OS: Windows 7 32 bit on BootCamp
System: MacBook Pro, 3 GBytes RAM, Core2Duo T8300@2.4 GHz,
Hi all,

I am using a Post Web Data action with a mySQL DB.
When I click on the button that has the action, nothing happens.
I traced this using Wireshark.

Usernames and passwords are ok.
I send a request to the server with no problem.
It seems like the server returns the string "articletitle" but this is the actual field name for my database and also my string and Opus variable.
So the server does not return the content of the field but just the field name.
I am really stuck here, any ideas?

Thanks
Dennis

See Wireshark output below, and my select.php below that.

POST /select.php HTTP/1.1

Accept: Accept: */*

Content-Type: application/x-www-form-urlencoded

User-Agent: Opus Publication

Host: [the host I am using]

Content-Length: 0

Cache-Control: no-cache



HTTP/1.1 200 OK

Date: Sat, 02 Nov 2013 19:49:50 GMT

Server: Apache/2.4.6 (Unix)

X-Powered-By: PHP/5.3.27

Cache-Control: max-age=86400

Expires: Sun, 03 Nov 2013 19:49:50 GMT

Transfer-Encoding: chunked

Content-Type: text/html

Connection: close



e

&articletitle=

0
=============================
==============================
Select.php:

<?php


$DBhost = "xxxx";
$DBuser = "xxxx";
$DBpass = "xxxx";
$DBName = "xxxx";

$connect = mysql_connect($DBhost,$DBuser,$DBpass);
$db = mysql_select_db($DBName,$connect);
$query = "SELECT * FROM cl40-dcms";
$result = mysql_query($query, $connect);

$row = mysql_fetch_array($result);

$data = "&articletitle=".$row['articletitle'];

echo $data



?>


For this message dzervas has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Post Web Data and mySQL - strange info returned
PostPosted: November 9th, 2013, 6:23 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Dennis,

I am surprised no-one has given some ideas here. Maybe it is just a busy time of year.

I have not used POST/GET, but in looking up some of these methods... I could raise one question.

Are you sure that your chosen SQL db allows hyphenated table names? And if so, should you put quote marks around the table name in the query.

One way to test this is to run you post/get on a table name that is not hyphenated, and see if that makes any difference.

Other than that, we'll have to wait until someone with PHP expertise chimes-in.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Post Web Data and mySQL - strange info returned
PostPosted: November 12th, 2013, 1:45 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
You say it's only showing the titles - I think that's due to this:
$data = "&articletitle=".$row['articletitle'];

you need to add more to the string e.g ... $data = "&articletitle=".$row['articletitle'].'&name='.$row['name'];

http://us1.php.net/mysql_fetch_array


For this message jezjones29 has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group