Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:34:27+00:00 2026-06-03T03:34:27+00:00

I apologise upfront this is really simply but causing me much annoyance. I have

  • 0

I apologise upfront this is really simply but causing me much annoyance. I have only been working on PHP a week or so and really learning by need at the minute. Below is my current issue. I am trying to pick up the Google Referral Keyword. Managed that now cant understand why it wont insert the value into the dbase table.

// capture referral url
$referringPage = parse_url( $_SERVER['HTTP_REFERER'] );
if ( stristr( $referringPage['host'], 'google.' ) )
{
  parse_str( $referringPage['query'], $queryVars );
  echo $queryVars['q']; // This is the search term used
}

// general form data insert
$sql="INSERT INTO refer_kws (kwid, keyword)
VALUES('','what value should I have here')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "";

mysql_close($con)

?>

I have tried several of the options and they just keep inputting Array as the value?? But when I use “? echo $_GET[‘q’] ?” on the page it works fine and displays the value?

I know this is simple. I really do but just cant get it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:34:28+00:00Added an answer on June 3, 2026 at 3:34 am

    You shouldn’t put the array between ”, that will make it a string. Because the string value of an array is “Array” it will store “Array” in the database. VALUES('',$referringPage)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologise if this has been asked before but I can't find the info
This might be a really simple question and I apologise if it has been
I apologise for the blatant ignorance of this question but I've been charged with
Please apologise me for doing this probably silly question but im working on eclipse
I apologise if this question has already been asked. I'm really new to Python
I apologise if this question has already been asked on here before but I
I apologize upfront if this has already been answered on SO but I'm going
I apologise if this has been asked before but I've looked for an example
This might be a really simple question and I apologise if it has been
I apologise if this is a bit dim but I want to send something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.