Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Problem with PHP code
Old 07-31-2009, 03:21 PM Problem with PHP code
Junior Talker

Posts: 2
Name: Matic
Trades: 0
Hey guys and girls

I am n00b

My problem is that I want to install a drupal site on my domain

I uploaded the files. Installed the mysql database.

I run the page and this comes up

Parse error: syntax error, unexpected T_STRING, expecting '{' in..../profiles/satellite/modules/content_complete/content_complete.module on line 136

-----------------------------------
this is the line 136

function content_complete_get_data($content_type, &$user) NULL) {
if (!$user) {
global $user;
}

$fields = content_complete_get_fields($content_type); // all fields
$tagged_fields = content_complete_get_tagged_fields($content_type); // fields tagged for completed (can be empty)
$user_fields = content_complete_get_user_fields($content_type, $user); // fields completed by the user (can be empty)

/**
* Only consider the first instance for now
Maticijus is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2009, 03:25 PM Re: Problem with PHP code
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Remove the NULL )
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-31-2009, 04:12 PM Re: Problem with PHP code
Junior Talker

Posts: 2
Name: Matic
Trades: 0
tnx for the fast reply

It did not work...

Parse error: syntax error, unexpected '=', expecting ')'

function content_complete_get_data($content_type, &$user = NULL) {
if (!$user) {
global $user;
}

$fields = content_complete_get_fields($content_type); // all fields
$tagged_fields = content_complete_get_tagged_fields($content_type); // fields tagged for completed (can be empty)
$user_fields = content_complete_get_user_fields($content_type, $user); // fields completed by the user (can be empty)
Maticijus is offline
Reply With Quote
View Public Profile
 
Old 07-31-2009, 04:37 PM Re: Problem with PHP code
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
I don't think its possible to assign a default value to something that is being passed as a reference.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-31-2009, 04:38 PM Re: Problem with PHP code
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
If I were you, I would use the following instead...

function content_complete_get_data($content_type) {
global $user;


. . . .
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 08-06-2009, 07:30 AM Re: Problem with PHP code
Average Talker

Posts: 19
Trades: 0
Hi can anyone help me?

I am trying to write a line of code that does not display a piece of text if a field in my database is empty or to only display it if there is content in the database field.

The code looks something like this.

<?php if (!empty($row_select_recipe['notes'] {echo '<br>Notes&nbsp;<?php echo $row_select_recipe['notes'];?>';} ?>

Many thanks
__________________

Please login or register to view this content. Registration is FREE
Hallbjörn Ólaf is offline
Reply With Quote
View Public Profile
 
Old 08-07-2009, 10:28 AM Re: Problem with PHP code
yashory's Avatar
Novice Talker

Posts: 12
Trades: 0
I think it's not possible to assign a value to an argument of a function
Remove "= NULL" and try it
yashory is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with PHP code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28972 seconds with 12 queries